From: Kevin Wolf Date: Thu, 22 Sep 2011 12:21:30 +0000 (+0200) Subject: linux-aio: Fix laio_submit error handling X-Git-Tag: v1.0-rc0~127^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=449c184ed23c6238da7fcc8b965c8fcc865d72a9;p=thirdparty%2Fqemu.git linux-aio: Fix laio_submit error handling 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 --- diff --git a/linux-aio.c b/linux-aio.c index bffa6cd0e39..50da75db197 100644 --- a/linux-aio.c +++ b/linux-aio.c @@ -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; }