Commit 373a1411 authored by Bart Van Assche's avatar Bart Van Assche Committed by Greg Kroah-Hartman
Browse files

scsi: mpt3sas: Fix _transport_smp_handler() error path

commit 91b7bdb2 upstream.

This patch avoids that smatch complains about a double unlock on

Fixes: 651a0136

 ("scsi: scsi_transport_sas: switch to bsg-lib for SMP passthrough")
Signed-off-by: default avatarBart Van Assche <>
Cc: Christoph Hellwig <>
Cc: Sathya Prakash <>
Cc: Chaitra P B <>
Cc: Suganath Prabu Subramani <>
Reviewed-by: default avatarChristoph Hellwig <>
Signed-off-by: default avatarMartin K. Petersen <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 8039fa72
......@@ -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",
__func__, ioc->name);
rc = -EFAULT;
goto out;
goto job_done;
rc = mutex_lock_interruptible(&ioc->transport_cmds.mutex);
if (rc)
goto out;
goto job_done;
if (ioc->transport_cmds.status != MPT3_CMD_NOT_USED) {
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,
ioc->transport_cmds.status = MPT3_CMD_NOT_USED;
bsg_job_done(job, rc, reslen);
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