All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: mpi3mr: Fix tgtdev reference count in mpi3mr_pcietopochg_evt_bh()
@ 2026-09-17 15:03 Wentao Liang
  2026-09-17 15:19 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2026-09-17 15:03 UTC (permalink / raw)
  To: James.Bottomley
  Cc: hare, himanshu.madhani, kashyap.desai, linux-kernel, linux-scsi,
	martin.petersen, mpi3mr-linuxdrv.pdl, sathya.prakash,
	sreekanth.reddy, sumit.saxena, thenzl, Wentao Liang, stable

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@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 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


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

end of thread, other threads:[~2026-09-17 15:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 15:03 [PATCH] scsi: mpi3mr: Fix tgtdev reference count in mpi3mr_pcietopochg_evt_bh() Wentao Liang
2026-09-17 15:19 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.