]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: mpt3sas: Fix _ctl_get_mpt_mctp_passthru_adapter() to return IOC pointer
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Wed, 14 May 2025 09:09:41 +0000 (02:09 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 21 May 2025 02:03:15 +0000 (22:03 -0400)
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>
Link: https://lore.kernel.org/r/1747213781-31545-1-git-send-email-shivasharan.srikanteshwara@broadcom.com
Fixes: c72be4b5bb7c ("scsi: mpt3sas: Add support for MCTP Passthrough commands")
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_ctl.c

index 063b10dd82514e2a4b35dab9e623942b7b01dd7c..02fc204b9bf7b276115bf6db52746155381799fd 100644 (file)
@@ -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);