From patchwork Fri Mar 28 14:22:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 334711 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 951C614008C for ; Sat, 29 Mar 2014 01:23:17 +1100 (EST) Received: from localhost ([::1]:33877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTXgf-0001G3-PZ for incoming@patchwork.ozlabs.org; Fri, 28 Mar 2014 10:23:13 -0400 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 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WTXgH-0000VK-2w; Fri, 28 Mar 2014 14:22:49 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 28 Mar 2014 14:22:49 +0000 Message-Id: <1396016569-1913-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Kevin Wolf , Stefan Hajnoczi , patches@linaro.org Subject: [Qemu-devel] [PATCH 1/2] dma-helpers: Initialize DMAAIOCB in_cancel flag X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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 Reviewed-by: Stefan Hajnoczi --- 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);