Received: from eggs.gnu.org ([2001:4830:134:3::10]:40001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW9md-0007S6-6N for qemu-devel@nongnu.org; Fri, 04 Apr 2014 15:28:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WW9mY-0007gM-CW for qemu-devel@nongnu.org; Fri, 04 Apr 2014 15:28:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW9mY-0007gI-5W for qemu-devel@nongnu.org; Fri, 04 Apr 2014 15:28:06 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s34JS5XI016177 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 4 Apr 2014 15:28:05 -0400 From: Kevin Wolf Date: Fri, 4 Apr 2014 21:27:47 +0200 Message-Id: <1396639669-24348-9-git-send-email-kwolf@redhat.com> In-Reply-To: <1396639669-24348-1-git-send-email-kwolf@redhat.com> References: <1396639669-24348-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 08/10] 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: kwolf@redhat.com From: Peter Maydell 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 Signed-off-by: Kevin Wolf --- 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.8.3.1