From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTXgR-0001Fv-11 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 10:22:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTXgQ-0005Gg-7Z for qemu-devel@nongnu.org; Fri, 28 Mar 2014 10:22:58 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:47174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTXgQ-0005FY-0S for qemu-devel@nongnu.org; Fri, 28 Mar 2014 10:22:58 -0400 From: Peter Maydell Date: Fri, 28 Mar 2014 14:22:49 +0000 Message-Id: <1396016569-1913-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 1/2] dma-helpers: Initialize DMAAIOCB in_cancel flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , patches@linaro.org Initialize the dbs->in_cancel flag in dma_bdrv_io(), since qemu_aio_get() does not return zero-initialized memory. Spotted by the clang sanitizer (which complained when the value loaded in dma_complete() was not valid for a bool type); this might have resulted in leaking the AIO block. Signed-off-by: Peter Maydell --- dma-helpers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dma-helpers.c b/dma-helpers.c index c9620a5..5f421e9 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -213,6 +213,7 @@ BlockDriverAIOCB *dma_bdrv_io( dbs->sg_cur_index = 0; dbs->sg_cur_byte = 0; dbs->dir = dir; + dbs->in_cancel = false; dbs->io_func = io_func; dbs->bh = NULL; qemu_iovec_init(&dbs->iov, sg->nsg); -- 1.9.0