Skip to contentSkip to conversation

scsi: bvme6000: put SCSI host on remove

PATCH New Guangshuo Li 1 participant 1 message Sep 18

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: bvme6000: put SCSI host on remove

bvme6000_probe() obtains a SCSI host through NCR_700_detect(). The probe failure path drops the host reference with scsi_host_put(), but the normal remove path does not perform the corresponding cleanup.

As a result, the SCSI host reference remains allocated after the driver is removed.

Call scsi_host_put() after the IRQ has been released to drop the host reference acquired during probe.

This issue was found by manual code inspection.

Fixes 8276b58af4dd ("[SCSI] 53c700: m68k BVME6000 NCR53C710 SCSI")
---
 drivers/scsi/bvme6000_scsi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/bvme6000_scsi.c +1 -0
index 23301edf100d..0beb4a2e5a23 100644
@@ -99,6 +99,7 @@ bvme6000_device_remove(struct platform_device *dev)
 	NCR_700_release(host);
 	kfree(hostdata);
 	free_irq(host->irq, host);
+	scsi_host_put(host);
 }
 
 static struct platform_driver bvme6000_scsi_driver = {
Signature · 1 line
2.43.0