mirror of
https://github.com/qemu/qemu.git
synced 2024-11-23 19:03:38 +08:00
block: Fix multiwrite memory leak in error case
Previously multiwrite_user_cb was never called if a request in the multiwrite batch failed right away because it did set mcb->error immediately. Make it look more like a normal callback to fix this. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
0f0b604b00
commit
7eb58a6c55
3
block.c
3
block.c
@ -1884,7 +1884,8 @@ int bdrv_aio_multiwrite(BlockDriverState *bs, BlockRequest *reqs, int num_reqs)
|
|||||||
reqs[i].error = -EIO;
|
reqs[i].error = -EIO;
|
||||||
goto fail;
|
goto fail;
|
||||||
} else {
|
} else {
|
||||||
mcb->error = -EIO;
|
mcb->num_requests++;
|
||||||
|
multiwrite_cb(mcb, -EIO);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user