From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVyPI-0008ST-9l for qemu-devel@nongnu.org; Fri, 04 Apr 2014 03:19:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVyPD-0005j0-CY for qemu-devel@nongnu.org; Fri, 04 Apr 2014 03:19:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVyPD-0005it-40 for qemu-devel@nongnu.org; Fri, 04 Apr 2014 03:19:15 -0400 Date: Fri, 4 Apr 2014 09:19:11 +0200 From: Stefan Hajnoczi Message-ID: <20140404071911.GA9801@stefanha-thinkpad.redhat.com> References: <1396016569-1913-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1396016569-1913-1-git-send-email-peter.maydell@linaro.org> Subject: Re: [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: Peter Maydell Cc: Kevin Wolf , qemu-devel@nongnu.org, patches@linaro.org On Fri, Mar 28, 2014 at 02:22:49PM +0000, Peter Maydell wrote: > 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); Worth merging for 2.0. Reviewed-by: Stefan Hajnoczi