diff mbox series

[-next] scsi: mpi3mr: Fix missing unlock on error

Message ID 20210603152803.717505-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Headers show
Series [-next] scsi: mpi3mr: Fix missing unlock on error | expand

Commit Message

Yang Yingliang June 3, 2021, 3:28 p.m. UTC
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(-)

Comments

Kashyap Desai June 16, 2021, 1:46 p.m. UTC | #1
> 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
>
Martin K. Petersen June 19, 2021, 2:02 a.m. UTC | #2
Yang,

> Goto unlock path before return from function in the error handling
> case.

Applied to 5.14/scsi-staging, thanks!
diff mbox series

Patch

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;