diff options
| author | Fam Zheng | 2014-04-29 12:09:09 +0200 |
|---|---|---|
| committer | Kevin Wolf | 2014-04-29 13:43:00 +0200 |
| commit | 373df5b135b4a54e0abb394e9e703fef3ded093c (patch) | |
| tree | 150c0807f508d040691ab613a2df40522b211c0e /block | |
| parent | block: Ignore duplicate or NULL format_name in bdrv_iterate_format (diff) | |
| download | qemu-373df5b135b4a54e0abb394e9e703fef3ded093c.tar.gz qemu-373df5b135b4a54e0abb394e9e703fef3ded093c.tar.xz qemu-373df5b135b4a54e0abb394e9e703fef3ded093c.zip | |
mirror: Fix resource leak when bdrv_getlength fails
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>
Diffstat (limited to 'block')
| -rw-r--r-- | block/mirror.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/mirror.c b/block/mirror.c index 95366adb3a..403714c1ea 100644 --- 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); |
