The Monday 01 Sep 2014 à 15:43:10 (+0800), Liu Yuan wrote : > Cc: Eric Blake <ebl...@redhat.com> > Cc: Benoit Canet <ben...@irqsave.net> > Cc: Kevin Wolf <kw...@redhat.com> > Cc: Stefan Hajnoczi <stefa...@redhat.com> > Signed-off-by: Liu Yuan <namei.u...@gmail.com> > --- > block/quorum.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/block/quorum.c b/block/quorum.c > index 5866bca..9e056d6 100644 > --- a/block/quorum.c > +++ b/block/quorum.c > @@ -130,6 +130,12 @@ struct QuorumAIOCB { > > static bool quorum_vote(QuorumAIOCB *acb); > > +static void quorum_aio_release(QuorumAIOCB *acb) > +{ > + g_free(acb->qcrs); > + qemu_aio_release(acb); > +} > + > static void quorum_aio_cancel(BlockDriverAIOCB *blockacb) > { > QuorumAIOCB *acb = container_of(blockacb, QuorumAIOCB, common); > @@ -141,8 +147,7 @@ static void quorum_aio_cancel(BlockDriverAIOCB *blockacb) > bdrv_aio_cancel(acb->qcrs[i].aiocb); > } > > - g_free(acb->qcrs); > - qemu_aio_release(acb); > + quorum_aio_release(acb); > } > > static AIOCBInfo quorum_aiocb_info = { > @@ -168,8 +173,7 @@ static void quorum_aio_finalize(QuorumAIOCB *acb) > } > } > > - g_free(acb->qcrs); > - qemu_aio_release(acb); > + quorum_aio_release(acb); > } > > static bool quorum_sha256_compare(QuorumVoteValue *a, QuorumVoteValue *b) > -- > 1.9.1 >
Reviewed-by: Benoît Canet <benoit.ca...@nodalink.com>