Skip to contentSkip to conversation

scsi: dc395: fix error case unwinding

PATCH Applied Tong Zhang 3 participants 4 messages Sep 7, 2021 – Sep 29, 2021

Subsystems (2)
lore
Share & tools
lore

Tong Zhang

author
#0 lore raw

PATCH 1/1 scsi: dc395: fix error case unwinding

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]
---
 drivers/scsi/dc395x.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/dc395x.c +1 -0
index 24c7cefb0b78..1c79e6c27163 100644
@@ -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;
 	}
 
Signature · 1 line
2.25.1
#1 lore raw

According to Documentation/process/submitting-patches.rst it would be appropriate to put "RESEND" in the subject line.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Tong Zhang
Quoted 10 lines · 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]
Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Quoted 17 lines
---
 drivers/scsi/dc395x.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/dc395x.c +1 -0
index 24c7cefb0b78..1c79e6c27163 100644
@@ -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;
 	}
 
#3 lore raw
In reply to Tong Zhang
Quoted 10 lines · 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]

[...]

Applied to 5.16/scsi-queue, thanks!

[1/1] scsi: dc395: fix error case unwinding

      https://git.kernel.org/mkp/scsi/c/cbd9a3347c75
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering