From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6iHk-0002Sx-QF for qemu-devel@nongnu.org; Thu, 22 Sep 2011 08:21:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6iHj-0000qd-DD for qemu-devel@nongnu.org; Thu, 22 Sep 2011 08:21:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6iHj-0000qK-4U for qemu-devel@nongnu.org; Thu, 22 Sep 2011 08:21:47 -0400 From: Kevin Wolf Date: Thu, 22 Sep 2011 14:24:38 +0200 Message-Id: <1316694278-4265-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH] linux-aio: Fix laio_submit error handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, hch@lst.de 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 --- linux-aio.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-aio.c b/linux-aio.c index bffa6cd..50da75d 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; } -- 1.7.6.2