mirror of
https://github.com/qemu/qemu.git
synced 2024-11-28 14:24:02 +08:00
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>
This commit is contained in:
parent
e855e4fb7b
commit
373df5b135
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user