public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mpt3sas: Fix _ctl_get_mpt_mctp_passthru_adapter to return ioc pointer
@ 2025-05-14  9:09 Shivasharan S
  2025-05-21  2:03 ` Martin K. Petersen
  2025-05-28  2:20 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Shivasharan S @ 2025-05-14  9:09 UTC (permalink / raw)
  To: linux-scsi, martin.petersen
  Cc: sathya.prakash, ranjan.kumar, suganath-prabu.subramani,
	sumit.saxena, Shivasharan S

Fix _ctl_get_mpt_mctp_passthru_adapter() to return the correct IOC
pointer to caller based on dev_index.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_ctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index 063b10dd8251..02fc204b9bf7 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -2869,8 +2869,9 @@ _ctl_get_mpt_mctp_passthru_adapter(int dev_index)
 		if (ioc->facts.IOCCapabilities & MPI26_IOCFACTS_CAPABILITY_MCTP_PASSTHRU) {
 			if (count == dev_index) {
 				spin_unlock(&gioc_lock);
-				return 0;
+				return ioc;
 			}
+			count++;
 		}
 	}
 	spin_unlock(&gioc_lock);
-- 
2.43.0


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

end of thread, other threads:[~2025-05-28  2:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-14  9:09 [PATCH] mpt3sas: Fix _ctl_get_mpt_mctp_passthru_adapter to return ioc pointer Shivasharan S
2025-05-21  2:03 ` Martin K. Petersen
2025-05-28  2:20 ` Martin K. Petersen

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