rbd: Fix leaks in rbd_start_aio() error path
PATCH 1/1 rbd: Fix leaks in rbd_start_aio() error path
Signed-off-by Kevin Wolf <[email protected]>
--- block/rbd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
block/rbd.c +4 -1
@@ -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); +g_free (acb->bounce);qemu_aio_release (acb);return NULL ; }
Signature · 1 line
1.8.3.1
Quoted 14 lines · Kevin Wolf
Signed-off-by Kevin Wolf <[email protected]>--- block/rbd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)block/rbd.c +0
-1@@ -684,13 +684,16 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, }if (r <0 ) { - goto failed;
block/rbd.c static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, · line 696
Quoted 10 lines
block/rbd.c +4
-0+ goto failed_completion; }return &acb->common; +failed_completion: +rbd_aio_release (c); failed:g_free (rcb); +g_free (acb->bounce);
Err, Isn't it blockaligned ? (qemu_vfree) ?
Quoted 7 lines
block/rbd.c +0
-0qemu_aio_release (acb);return NULL ; }Signature · 1 line
1.8.3.1
Am 05.06.2014 um 16:15 hat Benoît Canet geschrieben:
Quoted 20 lines
Quoted 19 lines · Kevin Wolf
Signed-off-by Kevin Wolf <[email protected]>--- block/rbd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)block/rbd.c +1
-1@@ -684,13 +684,16 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, }if (r <0 ) { - goto failed; + goto failed_completion; }return &acb->common;
Quoted 7 lines
block/rbd.c static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, · line 696
Quoted 5 lines
block/rbd.c +3
-0+failed_completion: +rbd_aio_release (c); failed:g_free (rcb); +g_free (acb->bounce);Err, Isn't it blockaligned ? (
qemu_vfree) ?
*sigh* Yes, the patch was too trivial to get it right. Thanks for catching this.
Kevin