projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e855e4f
)
mirror: Fix resource leak when bdrv_getlength fails
author
Fam Zheng
<famz@redhat.com>
Tue, 29 Apr 2014 10:09:09 +0000
(18:09 +0800)
committer
Kevin Wolf
<kwolf@redhat.com>
Tue, 29 Apr 2014 11:43:00 +0000
(13:43 +0200)
The direct return will skip releasing of all the resouces at
immediate_exit, don't miss that.
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/mirror.c
patch
|
blob
|
history
diff --git
a/block/mirror.c
b/block/mirror.c
index 95366adb3a553e6da582d33daf4c1faf4f300622..403714c1ea356dcb3ad32618b356b148cf834b4d 100644
(file)
--- a/
block/mirror.c
+++ b/
block/mirror.c
@@
-325,8
+325,8
@@
static void coroutine_fn mirror_run(void *opaque)
s->common.len = bdrv_getlength(bs);
if (s->common.len <= 0) {
-
block_job_completed(&s->common, s->common.len)
;
-
return
;
+
ret = s->common.len
;
+
goto immediate_exit
;
}
length = DIV_ROUND_UP(s->common.len, s->granularity);