summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-11-08 09:44:15 +0100
committerNicholas Bellinger <nab@linux-iscsi.org>2017-11-08 10:42:35 +0100
commit97488c73190bb785cba818bf31e7361a27aded41 (patch)
treefe9e16a9f0aa7a635d62be56acf16a8a54f22c90 /drivers/target
parenttcmu: Fix some memory corruption (diff)
downloadlinux-97488c73190bb785cba818bf31e7361a27aded41.tar.xz
linux-97488c73190bb785cba818bf31e7361a27aded41.zip
tcmu: Add a missing unlock on an error path
We added a new error path here but we forgot to drop the lock first before returning. Fixes: 0d44374c1aae ("tcmu: fix double se_cmd completion") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_user.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index d2b8d5ccb446..bf4fd40dde2b 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -888,6 +888,7 @@ tcmu_queue_cmd_ring(struct tcmu_cmd *tcmu_cmd)
ret = tcmu_setup_cmd_timer(tcmu_cmd);
if (ret) {
tcmu_cmd_free_data(tcmu_cmd, tcmu_cmd->dbi_cnt);
+ mutex_unlock(&udev->cmdr_lock);
return TCM_OUT_OF_RESOURCES;
}
entry->hdr.cmd_id = tcmu_cmd->cmd_id;