summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/dc395x.c
diff options
context:
space:
mode:
authorTong Zhang <ztong0001@gmail.com>2021-09-07 06:07:02 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2021-09-22 06:19:51 +0200
commitcbd9a3347c757383f3d2b50cf7cfd03eb479c481 (patch)
tree07ab0cb5b34e26b2138c9b2ddd1a8c86f18dda70 /drivers/scsi/dc395x.c
parentscsi: ufs: core: Add temperature notification exception handling (diff)
downloadlinux-cbd9a3347c757383f3d2b50cf7cfd03eb479c481.tar.xz
linux-cbd9a3347c757383f3d2b50cf7cfd03eb479c481.zip
scsi: dc395: Fix error case unwinding
dc395x_init_one()->adapter_init() might fail. In this case, the acb is already cleaned 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] Link: https://lore.kernel.org/r/20210907040702.1846409-1-ztong0001@gmail.com Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reviewed-by: Finn Thain <fthain@linux-m68k.org> Signed-off-by: Tong Zhang <ztong0001@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/dc395x.c')
-rw-r--r--drivers/scsi/dc395x.c1
1 files changed, 1 insertions, 0 deletions
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;
}