* [Qemu-devel] [PATCH] iscsi: fix missing unlock
@ 2017-03-03 15:41 Paolo Bonzini
2017-03-03 16:14 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2017-03-03 15:41 UTC (permalink / raw)
To: qemu-devel
Reported by Coverity.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/iscsi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/iscsi.c b/block/iscsi.c
index 76319a1..75d8905 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;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] iscsi: fix missing unlock
2017-03-03 15:41 [Qemu-devel] [PATCH] iscsi: fix missing unlock Paolo Bonzini
@ 2017-03-03 16:14 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-03-03 16:14 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel
Hi Paolo,
On 03/03/2017 12:41 PM, Paolo Bonzini wrote:
> Reported by Coverity.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> block/iscsi.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/block/iscsi.c b/block/iscsi.c
> index 76319a1..75d8905 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;
what about:
r = -ENOMEM;
goto out_unlock;
to follow the file codestyle? (same following 3)
> }
> #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;
> }
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-03 16:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03 15:41 [Qemu-devel] [PATCH] iscsi: fix missing unlock Paolo Bonzini
2017-03-03 16:14 ` Philippe Mathieu-Daudé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.