aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2014-06-05 16:19:26 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2014-06-06 11:05:04 +0200
commit405a27640b33c31ccef4001b3f3936b8c9d2218f (patch)
tree58ef45728a54c43ce329ae52c8fdef9b9d498a15 /block
parentd6635c4dbbcfca7f5bd379dd970617fc3430428f (diff)
rbd: Fix leaks in rbd_start_aio() error path
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Josh Durgin <josh.durgin@inktank.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/rbd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block/rbd.c b/block/rbd.c
index a78760b7fe..93639f783c 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -685,13 +685,16 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs,
}
if (r < 0) {
- goto failed;
+ goto failed_completion;
}
return &acb->common;
+failed_completion:
+ rbd_aio_release(c);
failed:
g_free(rcb);
+ qemu_vfree(acb->bounce);
qemu_aio_release(acb);
return NULL;
}