Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] scsi: myrs: Put the SCSI device after logging a physical event
@ 2026-11-12  7:17 Zhu Jun
  2026-11-12  7:25 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Zhu Jun @ 2026-11-12  7:17 UTC (permalink / raw)
  To: hare; +Cc: James.Bottomley, mkp, linux-scsi, linux-kernel, Zhu Jun

myrs_log_event() takes a SCSI device reference when processing a
physical-device event, but does not release it after logging the event
and updating the cached device state. Each matching event leaks a
device reference and a reference to the low-level driver module.

Put the device after processing the physical event, including when no
host-private information is available.

Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller (SCSI interface)")
Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
 drivers/scsi/myrs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c
index 1192b01fab8e..1f248501a611 100644
--- a/drivers/scsi/myrs.c
+++ b/drivers/scsi/myrs.c
@@ -877,6 +877,8 @@ static void myrs_log_event(struct myrs_hba *cs, struct myrs_event *ev)
 				break;
 			}
 		}
+		if (sdev)
+			scsi_device_put(sdev);
 		break;
 	case 'L':
 		shost_printk(KERN_INFO, shost,
-- 
2.51.0




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

end of thread, other threads:[~2026-11-12  7:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12  7:17 [PATCH] scsi: myrs: Put the SCSI device after logging a physical event Zhu Jun
2026-11-12  7:25 ` sashiko-bot

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