Skip to contentSkip to conversation

scsi: aic79xx: Fix scsi_device reference leak in ahd_dump_target_state()

PATCH New Wentao Liang 1 participant 1 message Sep 17

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

PATCH 1/1 scsi: aic79xx: Fix scsi_device reference leak in ahd_dump_target_state()

ahd_dump_target_state() looks up each LUN with scsi_device_lookup_by_target(), which returns the device with a reference held, but the reference is never dropped. Put the device once its state has been dumped.

Fixes f89d0a4e1d01 ("[SCSI] aic79xx: remove slave_destroy")
---
 drivers/scsi/aic7xxx/aic79xx_proc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/aic7xxx/aic79xx_proc.c +1 -0
index aa37838b78a6..da8f2afdf405 100644
@@ -185,6 +185,7 @@ ahd_dump_target_state(struct ahd_softc *ahd, struct seq_file *m,
 			continue;
 
 		ahd_dump_device_state(m, dev);
+		scsi_device_put(dev);
 	}
 }
 
Signature · 1 line
2.34.1