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 <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2011-09-22 14:21:30 +02:00
parent 55b949c847
commit 449c184ed2
1 changed files with 2 additions and 2 deletions

View 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;
}