[PATCH] scsi: mpi3mr: Fix tgtdev reference count in mpi3mr_pcietopochg_evt_bh()
From: Wentao Liang
Date: Thu Sep 17 2026 - 11:07:38 EST
mpi3mr_get_tgtdev_by_handle() takes a reference on the target device
and the loop drops it with mpi3mr_tgtdev_put() at the end of every
iteration. The MPI3_EVENT_PCIE_TOPO_PS_NOT_RESPONDING branch drops the
same reference a second time before breaking out, so the reference is
put twice and the kref can be released prematurely.
Drop the redundant put and let the loop release the reference once.
Fixes: 8e653455547a ("scsi: mpi3mr: Add support for PCIe device event handling")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
---
drivers/scsi/mpi3mr/mpi3mr_os.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 8a2575171e1f..0c974f2627d1 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -2027,7 +2027,6 @@ static void mpi3mr_pcietopochg_evt_bh(struct mpi3mr_ioc *mrioc,
if (tgtdev->host_exposed)
mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev);
mpi3mr_tgtdev_del_from_list(mrioc, tgtdev, false);
- mpi3mr_tgtdev_put(tgtdev);
break;
default:
break;
--
2.34.1