mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: aic79xx: Fix scsi_device reference leak in ahd_dump_target_state()
@ 2026-09-17 14:34 Wentao Liang
  0 siblings, 0 replies; only message in thread
From: Wentao Liang @ 2026-09-17 14:34 UTC (permalink / raw)
  To: James.Bottomley
  Cc: James.Bottomley, hare, linux-kernel, linux-scsi, martin.petersen,
	Wentao Liang, stable

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")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/scsi/aic7xxx/aic79xx_proc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/aic7xxx/aic79xx_proc.c b/drivers/scsi/aic7xxx/aic79xx_proc.c
index aa37838b78a6..da8f2afdf405 100644
--- a/drivers/scsi/aic7xxx/aic79xx_proc.c
+++ b/drivers/scsi/aic7xxx/aic79xx_proc.c
@@ -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);
 	}
 }
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-17 14:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 14:34 [PATCH] scsi: aic79xx: Fix scsi_device reference leak in ahd_dump_target_state() Wentao Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®