[PATCH v2 09/17] mpi3mr: Fix target device reference leak in device removal handshake
Chandrakanth Patil <[email protected]>
| Newsgroups | org.kernel.vger.linux-scsi |
|---|---|
| Message-ID | <[email protected]> |
The device removal handshake looks up the target device to update its
state but never drops the reference that the lookup takes.
Drop it once the state has been updated.
Fixes: 13ef29ea4aa0 ("scsi: mpi3mr: Add support for device add/remove event handling")
Signed-off-by: Chandrakanth Patil <[email protected]>
---
v2:
- No changes from v1.
drivers/scsi/mpi3mr/mpi3mr_os.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 2a35f146fe69..9aeec6146acb 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -2536,6 +2536,9 @@ static void mpi3mr_dev_rmhs_send_tm(struct mpi3mr_ioc *mrioc, u16 handle,
tgtdev->state = MPI3MR_DEV_REMOVE_HS_STARTED;
spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags);
+ if (tgtdev)
+ mpi3mr_tgtdev_put(tgtdev);
+
if (drv_cmd)
goto issue_cmd;
do {
--
2.52.0