Skip to contentSkip to conversation

scsi: mpi3mr: Fix error return code in mpi3mr_init_ioc()

PATCH RESEND Applied Yang Yingliang 3 participants 3 messages Jun 3, 2021 – Jun 19, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 scsi: mpi3mr: Fix error return code in mpi3mr_init_ioc()

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Fixes fb9b04574f14 ("scsi: mpi3mr: Add support for recovering controller")
Fixes 824a156633df ("scsi: mpi3mr: Base driver code")
---
 drivers/scsi/mpi3mr/mpi3mr_fw.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/scsi/mpi3mr/mpi3mr_fw.c +2 -0
index acb2be62080a..dbf116414855 100644
@@ -3295,6 +3295,7 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc, u8 re_init)
 	}
 	ioc_state = mpi3mr_get_iocstate(mrioc);
 	if (ioc_state != MRIOC_STATE_RESET) {
+		retval = -1;
 		ioc_err(mrioc, "Cannot bring IOC to reset state\n");
 		goto out_failed;
 	}
@@ -3391,6 +3392,7 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc, u8 re_init)
 
 	if (re_init &&
 	    (mrioc->shost->nr_hw_queues > mrioc->num_op_reply_q)) {
+		retval = -1;
 		ioc_err(mrioc,
 		    "Cannot create minimum number of OpQueues expected:%d created:%d\n",
 		    mrioc->shost->nr_hw_queues, mrioc->num_op_reply_q);
Signature · 1 line
2.25.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 25 lines · Yang Yingliang

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Fixes fb9b04574f14 ("scsi: mpi3mr: Add support for recovering controller")
Fixes 824a156633df ("scsi: mpi3mr: Base driver code")
---
 drivers/scsi/mpi3mr/mpi3mr_fw.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/scsi/mpi3mr/mpi3mr_fw.c +1 -0
index acb2be62080a..dbf116414855 100644
@@ -3295,6 +3295,7 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc, u8 re_init)
        }
        ioc_state = mpi3mr_get_iocstate(mrioc);
        if (ioc_state != MRIOC_STATE_RESET) {
+               retval = -1;
                ioc_err(mrioc, "Cannot bring IOC to reset state\n");
                goto out_failed;
        }

drivers/scsi/mpi3mr/mpi3mr_fw.c int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc, u8 re_init)

Quoted 8 lines
drivers/scsi/mpi3mr/mpi3mr_fw.c +1 -1
@@ -3391,6 +3392,7 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc, u8 re_init)
 
        if (re_init &&
            (mrioc->shost->nr_hw_queues > mrioc->num_op_reply_q)) {
+               retval = -1;
                ioc_err(mrioc,
                    "Cannot create minimum number of OpQueues expected:%d created:%d\n",
                    mrioc->shost->nr_hw_queues, mrioc->num_op_reply_q);
--
Quoted 2 lines

2.25.1

#2 lore raw
In reply to Yang Yingliang

Yang,

Quoted 2 lines

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Applied to 5.14/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering