qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-aio: Fix laio_submit error handling
@ 2011-09-22 12:24 Kevin Wolf
  0 siblings, 0 replies; only message in thread
From: Kevin Wolf @ 2011-09-22 12:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, hch

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 |    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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-22 12:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-22 12:24 [Qemu-devel] [PATCH] linux-aio: Fix laio_submit error handling Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).