Patchwork [1.1,6/6] block: avoid useless checks on acb->bh

login
register
mail settings
Submitter Paolo Bonzini
Date Nov. 14, 2011, 4:50 p.m.
Message ID <1321289454-9219-7-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/125560/
State New
Headers show

Comments

Paolo Bonzini - Nov. 14, 2011, 4:50 p.m.
Coverity is confused by this "if" and reports leaks on acb->bh.
The bottom half is always deleted before releasing the AIOCB,
in either bdrv_aio_cancel_em or bdrv_aio_bh_cb.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

Patch

diff --git a/block.c b/block.c
index 05b0e2c..e847738 100644
--- a/block.c
+++ b/block.c
@@ -2490,9 +2490,7 @@  static BlockDriverAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs,
     acb->is_write = is_write;
     acb->qiov = qiov;
     acb->bounce = qemu_blockalign(bs, qiov->size);
-
-    if (!acb->bh)
-        acb->bh = qemu_bh_new(bdrv_aio_bh_cb, acb);
+    acb->bh = qemu_bh_new(bdrv_aio_bh_cb, acb);
 
     if (is_write) {
         qemu_iovec_to_buffer(acb->qiov, acb->bounce);