|
From: | Josh Durgin |
Subject: | Re: [Qemu-devel] [PATCH v2] rbd: Fix leaks in rbd_start_aio() error path |
Date: | Thu, 05 Jun 2014 15:02:32 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
On 06/05/2014 07:19 AM, Kevin Wolf wrote:
Signed-off-by: Kevin Wolf <address@hidden> --- block/rbd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/block/rbd.c b/block/rbd.c index 09af484..898fcfe 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -684,13 +684,16 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, } if (r < 0) { - goto failed; + goto failed_completion; } return &acb->common; +failed_completion: + rbd_aio_release(c); failed: g_free(rcb); + qemu_vfree(acb->bounce); qemu_aio_release(acb); return NULL; }
Reviewed-by: Josh Durgin <address@hidden> FWIW this error path can only happen in certain combinations of odd circumstances, including specific forms of disk corruption of certain objects in concert with other factors, so it's quite unlikely to occur in practice.
[Prev in Thread] | Current Thread | [Next in Thread] |