提交 91b7bdb2 编写于 作者: B Bart Van Assche 提交者: Martin K. Petersen

scsi: mpt3sas: Fix _transport_smp_handler() error path

This patch avoids that smatch complains about a double unlock on
ioc->transport_cmds.mutex.

Fixes: 651a0136 ("scsi: scsi_transport_sas: switch to bsg-lib for SMP passthrough")
Signed-off-by: NBart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sathya Prakash <sathya.prakash@broadcom.com>
Cc: Chaitra P B <chaitra.basappa@broadcom.com>
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Cc: stable@vger.kernel.org
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 84203b35
...@@ -1936,12 +1936,12 @@ _transport_smp_handler(struct bsg_job *job, struct Scsi_Host *shost, ...@@ -1936,12 +1936,12 @@ _transport_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
pr_info(MPT3SAS_FMT "%s: host reset in progress!\n", pr_info(MPT3SAS_FMT "%s: host reset in progress!\n",
__func__, ioc->name); __func__, ioc->name);
rc = -EFAULT; rc = -EFAULT;
goto out; goto job_done;
} }
rc = mutex_lock_interruptible(&ioc->transport_cmds.mutex); rc = mutex_lock_interruptible(&ioc->transport_cmds.mutex);
if (rc) if (rc)
goto out; goto job_done;
if (ioc->transport_cmds.status != MPT3_CMD_NOT_USED) { if (ioc->transport_cmds.status != MPT3_CMD_NOT_USED) {
pr_err(MPT3SAS_FMT "%s: transport_cmds in use\n", ioc->name, pr_err(MPT3SAS_FMT "%s: transport_cmds in use\n", ioc->name,
...@@ -2066,6 +2066,7 @@ _transport_smp_handler(struct bsg_job *job, struct Scsi_Host *shost, ...@@ -2066,6 +2066,7 @@ _transport_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
out: out:
ioc->transport_cmds.status = MPT3_CMD_NOT_USED; ioc->transport_cmds.status = MPT3_CMD_NOT_USED;
mutex_unlock(&ioc->transport_cmds.mutex); mutex_unlock(&ioc->transport_cmds.mutex);
job_done:
bsg_job_done(job, rc, reslen); bsg_job_done(job, rc, reslen);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册