]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-aio: Fix laio_submit error handling
authorKevin Wolf <kwolf@redhat.com>
Thu, 22 Sep 2011 12:21:30 +0000 (14:21 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 11 Oct 2011 07:41:47 +0000 (09:41 +0200)
The error handling order was in the wrong order, so that either the ACB would
be leaked or the counter would be decremented when it shouldn't.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
linux-aio.c

index bffa6cd0e393fe5b5b125ca8cdf0d3b795aad76b..50da75db19754368a2b87fb69d30a1689f4f1558 100644 (file)
@@ -185,10 +185,10 @@ BlockDriverAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
         goto out_dec_count;
     return &laiocb->common;
 
-out_free_aiocb:
-    qemu_aio_release(laiocb);
 out_dec_count:
     s->count--;
+out_free_aiocb:
+    qemu_aio_release(laiocb);
     return NULL;
 }