Received: from eggs.gnu.org ([140.186.70.92]:42130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbBxE-0000Ma-5t for qemu-devel@nongnu.org; Thu, 15 Dec 2011 09:06:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbBx8-0004cn-PI for qemu-devel@nongnu.org; Thu, 15 Dec 2011 09:06:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbBx8-0004cj-GR for qemu-devel@nongnu.org; Thu, 15 Dec 2011 09:06:30 -0500 From: Kevin Wolf Date: Thu, 15 Dec 2011 15:09:21 +0100 Message-Id: <1323958169-8333-7-git-send-email-kwolf@redhat.com> In-Reply-To: <1323958169-8333-1-git-send-email-kwolf@redhat.com> References: <1323958169-8333-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 06/14] block: avoid useless checks on acb->bh List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Paolo Bonzini 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 Signed-off-by: Kevin Wolf --- block.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index 16a4c42..3f072f6 100644 --- a/block.c +++ b/block.c @@ -3077,9 +3077,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); -- 1.7.6.4