* [PATCH -next resend] scsi: mpi3mr: Fix error return code in mpi3mr_init_ioc()
@ 2021-06-03 15:16 Yang Yingliang
2021-06-16 13:44 ` Kashyap Desai
2021-06-19 2:03 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2021-06-03 15:16 UTC (permalink / raw)
To: linux-kernel, linux-scsi; +Cc: jejb, martin.petersen
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")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/scsi/mpi3mr/mpi3mr_fw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index acb2be62080a..dbf116414855 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -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);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next resend] scsi: mpi3mr: Fix error return code in mpi3mr_init_ioc()
2021-06-03 15:16 [PATCH -next resend] scsi: mpi3mr: Fix error return code in mpi3mr_init_ioc() Yang Yingliang
@ 2021-06-16 13:44 ` Kashyap Desai
2021-06-19 2:03 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Kashyap Desai @ 2021-06-16 13:44 UTC (permalink / raw)
To: Yang Yingliang
Cc: linux-kernel, linux-scsi, James E . J . Bottomley, Martin K. Petersen
[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]
On Thu, Jun 3, 2021 at 8:42 PM Yang Yingliang <yangyingliang@huawei.com> wrote:
>
> 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")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/scsi/mpi3mr/mpi3mr_fw.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
> index acb2be62080a..dbf116414855 100644
> --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
> +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
> @@ -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);
> --
Acked-by: Kashyap Desai <kashyap.desai@broadcom.com>
> 2.25.1
>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4212 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next resend] scsi: mpi3mr: Fix error return code in mpi3mr_init_ioc()
2021-06-03 15:16 [PATCH -next resend] scsi: mpi3mr: Fix error return code in mpi3mr_init_ioc() Yang Yingliang
2021-06-16 13:44 ` Kashyap Desai
@ 2021-06-19 2:03 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-06-19 2:03 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-kernel, linux-scsi, jejb, martin.petersen
Yang,
> 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!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-19 2:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 15:16 [PATCH -next resend] scsi: mpi3mr: Fix error return code in mpi3mr_init_ioc() Yang Yingliang
2021-06-16 13:44 ` Kashyap Desai
2021-06-19 2:03 ` 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;
as well as URLs for NNTP newsgroup(s).