* [Qemu-devel] [PATCH] rbd: Fix leaks in rbd_start_aio() error path
@ 2014-06-05 13:55 Kevin Wolf
2014-06-05 14:15 ` Benoît Canet
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Wolf @ 2014-06-05 13:55 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, benoit.canet, stefanha, josh.durgin
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/rbd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/block/rbd.c b/block/rbd.c
index 09af484..94e2bfd 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);
+ g_free(acb->bounce);
qemu_aio_release(acb);
return NULL;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] rbd: Fix leaks in rbd_start_aio() error path
2014-06-05 13:55 [Qemu-devel] [PATCH] rbd: Fix leaks in rbd_start_aio() error path Kevin Wolf
@ 2014-06-05 14:15 ` Benoît Canet
2014-06-05 14:18 ` Kevin Wolf
0 siblings, 1 reply; 3+ messages in thread
From: Benoît Canet @ 2014-06-05 14:15 UTC (permalink / raw)
To: Kevin Wolf; +Cc: benoit.canet, josh.durgin, qemu-devel, stefanha
The Thursday 05 Jun 2014 à 15:55:27 (+0200), Kevin Wolf wrote :
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/rbd.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/block/rbd.c b/block/rbd.c
> index 09af484..94e2bfd 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);
> + g_free(acb->bounce);
Err, Isn't it blockaligned ? (qemu_vfree) ?
> qemu_aio_release(acb);
> return NULL;
> }
> --
> 1.8.3.1
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] rbd: Fix leaks in rbd_start_aio() error path
2014-06-05 14:15 ` Benoît Canet
@ 2014-06-05 14:18 ` Kevin Wolf
0 siblings, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2014-06-05 14:18 UTC (permalink / raw)
To: Benoît Canet; +Cc: josh.durgin, qemu-devel, stefanha
Am 05.06.2014 um 16:15 hat Benoît Canet geschrieben:
> The Thursday 05 Jun 2014 à 15:55:27 (+0200), Kevin Wolf wrote :
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > ---
> > block/rbd.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/block/rbd.c b/block/rbd.c
> > index 09af484..94e2bfd 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);
> > + 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-05 14:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-05 13:55 [Qemu-devel] [PATCH] rbd: Fix leaks in rbd_start_aio() error path Kevin Wolf
2014-06-05 14:15 ` Benoît Canet
2014-06-05 14:18 ` 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).