aboutsummaryrefslogtreecommitdiff
path: root/block/iscsi.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-03-03 16:23:36 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2017-03-03 16:41:20 +0100
commitf6eb0b319e4bad3d01d74d71e3a6cf40f0ede720 (patch)
treee0a0e4726903510251e4c24b8367780902e16ad8 /block/iscsi.c
parent377a07aa0d1617736289bfa9a9cbdc73de4e6542 (diff)
iscsi: fix missing unlock
Reported by Coverity. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block/iscsi.c')
-rw-r--r--block/iscsi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/iscsi.c b/block/iscsi.c
index 76319a1a6e..75d890538e 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -637,6 +637,7 @@ retry:
}
#endif
if (iTask.task == NULL) {
+ qemu_mutex_unlock(&iscsilun->mutex);
return -ENOMEM;
}
#if LIBISCSI_API_VERSION < (20160603)
@@ -864,6 +865,7 @@ retry:
}
#endif
if (iTask.task == NULL) {
+ qemu_mutex_unlock(&iscsilun->mutex);
return -ENOMEM;
}
#if LIBISCSI_API_VERSION < (20160603)
@@ -904,6 +906,7 @@ static int coroutine_fn iscsi_co_flush(BlockDriverState *bs)
retry:
if (iscsi_synchronizecache10_task(iscsilun->iscsi, iscsilun->lun, 0, 0, 0,
0, iscsi_co_generic_cb, &iTask) == NULL) {
+ qemu_mutex_unlock(&iscsilun->mutex);
return -ENOMEM;
}
@@ -1237,6 +1240,7 @@ retry:
0, 0, iscsi_co_generic_cb, &iTask);
}
if (iTask.task == NULL) {
+ qemu_mutex_unlock(&iscsilun->mutex);
return -ENOMEM;
}