aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'block.c')
-rw-r--r--block.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/block.c b/block.c
index fd09dffb6c..6479072e9b 100644
--- a/block.c
+++ b/block.c
@@ -1306,6 +1306,11 @@ static BlockDriverAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs,
s->aiocb = bdrv_aio_read(bs, sector_num, s->bounce, nb_sectors,
bdrv_aio_rw_vector_cb, s);
}
+ if (!s->aiocb) {
+ qemu_vfree(s->bounce);
+ qemu_aio_release(s);
+ return NULL;
+ }
return &s->common;
}