Skip to contentSkip to conversation

linux-aio: Fix laio_submit error handling

PATCH New Kevin Wolf 1 participant 1 message Sep 22, 2011

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 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.

---
 linux-aio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
linux-aio.c +2 -2
index bffa6cd..50da75d 100644
@@ -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;
 }
 
Signature · 1 line
1.7.6.2