[PATCH] scsi: myrs: Put the SCSI device after logging a physical event
From: Zhu Jun
Date: Thu Nov 12 2026 - 02:30:14 EST
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@xxxxxxxxxxxxxxxxxxxx>
---
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