[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a68837f4-1ff7-76d5-7a68-80d2c0dbd95e@linux-m68k.org>
Date: Tue, 21 Sep 2021 09:56:29 +1000 (AEST)
From: Finn Thain <fthain@...ux-m68k.org>
To: Tong Zhang <ztong0001@...il.com>
cc: Oliver Neukum <oliver@...kum.org>, Ali Akcaagac <aliakc@....de>,
Jamie Lenehan <lenehan@...bble.org>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
dc395x@...bble.org, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] scsi: dc395: fix error case unwinding
On Mon, 6 Sep 2021, Tong Zhang wrote:
> dc395x_init_one()->adapter_init() might fail. In this case, the acb
> is already clean up by adapter_init(), no need to do that in
> adapter_uninit(acb) again.
>
> [ 1.252251] dc395x: adapter init failed
> [ 1.254900] RIP: 0010:adapter_uninit+0x94/0x170 [dc395x]
> [ 1.260307] Call Trace:
> [ 1.260442] dc395x_init_one.cold+0x72a/0x9bb [dc395x]
>
> Signed-off-by: Tong Zhang <ztong0001@...il.com>
Reviewed-by: Finn Thain <fthain@...ux-m68k.org>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> ---
> drivers/scsi/dc395x.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
> index 24c7cefb0b78..1c79e6c27163 100644
> --- a/drivers/scsi/dc395x.c
> +++ b/drivers/scsi/dc395x.c
> @@ -4618,6 +4618,7 @@ static int dc395x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
> /* initialise the adapter and everything we need */
> if (adapter_init(acb, io_port_base, io_port_len, irq)) {
> dprintkl(KERN_INFO, "adapter init failed\n");
> + acb = NULL;
> goto fail;
> }
>
>
Powered by blists - more mailing lists