* [PATCH -next] scsi: mpi3mr: Fix missing unlock on error
@ 2021-06-03 15:28 Yang Yingliang
2021-06-16 13:46 ` Kashyap Desai
2021-06-19 2:02 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2021-06-03 15:28 UTC (permalink / raw)
To: linux-kernel, linux-scsi; +Cc: jejb, martin.petersen
Goto unlock path before return from function
in the error handling case.
Fixes: c9566231cfaf ("scsi: mpi3mr: Create operational request and reply queue pair")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/scsi/mpi3mr/mpi3mr_fw.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index dbf116414855..8aea1c2ae712 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -1583,7 +1583,7 @@ static int mpi3mr_create_op_reply_q(struct mpi3mr_ioc *mrioc, u16 qidx)
if (mrioc->init_cmds.state & MPI3MR_CMD_PENDING) {
retval = -1;
ioc_err(mrioc, "CreateRepQ: Init command is in use\n");
- goto out;
+ goto out_unlock;
}
mrioc->init_cmds.state = MPI3MR_CMD_PENDING;
mrioc->init_cmds.is_waiting = 1;
@@ -1692,7 +1692,7 @@ static int mpi3mr_create_op_req_q(struct mpi3mr_ioc *mrioc, u16 idx,
if (mrioc->init_cmds.state & MPI3MR_CMD_PENDING) {
retval = -1;
ioc_err(mrioc, "CreateReqQ: Init command is in use\n");
- goto out;
+ goto out_unlock;
}
mrioc->init_cmds.state = MPI3MR_CMD_PENDING;
mrioc->init_cmds.is_waiting = 1;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] scsi: mpi3mr: Fix missing unlock on error
2021-06-03 15:28 [PATCH -next] scsi: mpi3mr: Fix missing unlock on error Yang Yingliang
@ 2021-06-16 13:46 ` Kashyap Desai
2021-06-19 2:02 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Kashyap Desai @ 2021-06-16 13:46 UTC (permalink / raw)
To: Yang Yingliang
Cc: linux-kernel, linux-scsi, James E . J . Bottomley, Martin K. Petersen
[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]
> Goto unlock path before return from function
> in the error handling case.
>
> Fixes: c9566231cfaf ("scsi: mpi3mr: Create operational request and reply queue pair")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/scsi/mpi3mr/mpi3mr_fw.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
> index dbf116414855..8aea1c2ae712 100644
> --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
> +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
> @@ -1583,7 +1583,7 @@ static int mpi3mr_create_op_reply_q(struct mpi3mr_ioc *mrioc, u16 qidx)
> if (mrioc->init_cmds.state & MPI3MR_CMD_PENDING) {
> retval = -1;
> ioc_err(mrioc, "CreateRepQ: Init command is in use\n");
> - goto out;
> + goto out_unlock;
> }
> mrioc->init_cmds.state = MPI3MR_CMD_PENDING;
> mrioc->init_cmds.is_waiting = 1;
> @@ -1692,7 +1692,7 @@ static int mpi3mr_create_op_req_q(struct mpi3mr_ioc *mrioc, u16 idx,
> if (mrioc->init_cmds.state & MPI3MR_CMD_PENDING) {
> retval = -1;
> ioc_err(mrioc, "CreateReqQ: Init command is in use\n");
> - goto out;
> + goto out_unlock;
> }
> mrioc->init_cmds.state = MPI3MR_CMD_PENDING;
> mrioc->init_cmds.is_waiting = 1;
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] scsi: mpi3mr: Fix missing unlock on error
2021-06-03 15:28 [PATCH -next] scsi: mpi3mr: Fix missing unlock on error Yang Yingliang
2021-06-16 13:46 ` Kashyap Desai
@ 2021-06-19 2:02 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-06-19 2:02 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-kernel, linux-scsi, jejb, martin.petersen
Yang,
> Goto unlock path before return from function in the error handling
> case.
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:02 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:28 [PATCH -next] scsi: mpi3mr: Fix missing unlock on error Yang Yingliang
2021-06-16 13:46 ` Kashyap Desai
2021-06-19 2:02 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.