Commit f9dc034d authored by Yang Yingliang's avatar Yang Yingliang Committed by Martin K. Petersen

scsi: mpi3mr: Fix missing unlock on error

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

Link: https://lore.kernel.org/r/20210603152803.717505-1-yangyingliang@huawei.com
Fixes: c9566231 ("scsi: mpi3mr: Create operational request and reply queue pair")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Acked-by: default avatarKashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ebc076b3
...@@ -1585,7 +1585,7 @@ static int mpi3mr_create_op_reply_q(struct mpi3mr_ioc *mrioc, u16 qidx) ...@@ -1585,7 +1585,7 @@ static int mpi3mr_create_op_reply_q(struct mpi3mr_ioc *mrioc, u16 qidx)
if (mrioc->init_cmds.state & MPI3MR_CMD_PENDING) { if (mrioc->init_cmds.state & MPI3MR_CMD_PENDING) {
retval = -1; retval = -1;
ioc_err(mrioc, "CreateRepQ: Init command is in use\n"); 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.state = MPI3MR_CMD_PENDING;
mrioc->init_cmds.is_waiting = 1; mrioc->init_cmds.is_waiting = 1;
...@@ -1694,7 +1694,7 @@ static int mpi3mr_create_op_req_q(struct mpi3mr_ioc *mrioc, u16 idx, ...@@ -1694,7 +1694,7 @@ static int mpi3mr_create_op_req_q(struct mpi3mr_ioc *mrioc, u16 idx,
if (mrioc->init_cmds.state & MPI3MR_CMD_PENDING) { if (mrioc->init_cmds.state & MPI3MR_CMD_PENDING) {
retval = -1; retval = -1;
ioc_err(mrioc, "CreateReqQ: Init command is in use\n"); 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.state = MPI3MR_CMD_PENDING;
mrioc->init_cmds.is_waiting = 1; mrioc->init_cmds.is_waiting = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment