linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] scsi: dc395: fix error case unwinding
@ 2021-09-07  4:07 Tong Zhang
  2021-09-08  0:39 ` Finn Thain
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tong Zhang @ 2021-09-07  4:07 UTC (permalink / raw)
  To: Oliver Neukum, Ali Akcaagac, Jamie Lenehan, James E.J. Bottomley,
	Martin K. Petersen, dc395x, linux-scsi, linux-kernel
  Cc: Tong Zhang

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@gmail.com>
---
 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;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-29  4:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07  4:07 [PATCH v1] scsi: dc395: fix error case unwinding Tong Zhang
2021-09-08  0:39 ` Finn Thain
2021-09-20 23:56 ` Finn Thain
2021-09-29  4:20 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).