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: 27293 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AC9D720545 for ; Fri, 28 Mar 2014 14:22:54 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id oz11sf11353366veb.5 for ; Fri, 28 Mar 2014 07:22:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=SJuGMDwgt1shgsf5T/rROTDc3ARavFR7Cmok5LvjGTE=; b=POL9KuH6GVHPUgRot0v3r+ORPBtigx6zzfvPA47dZBaKZ7dNIPNIbBrUIDMyT0UEpZ 5a+cWXRhQY/aIcWJHImuZ+d7qY3/rrRFKrnIghs0Dnyq+aN20/IFZg0bsUZ+i48kjNta jbgMepn45ot6z7iR8gwK2XFlDpQvg/9jn3mi8VcOKwn+u8qETDE4E/Bni2erubGozpLg 8Y4u690dx9zUp63rR8rUnaNun0Rw3IPMUJi8jxk6gDPjeKwqG7N3b6YCd2UfIo6bNQLD pSUOfhoKMWxU57mMUFmITVo7E27G6yyoaOXW5Jl7LJAuuAueB928fYMZCQVzXBovFKEq BbNw== X-Gm-Message-State: ALoCoQnP3U55F2CivtF3YTFNR1OGIbDw9HpPd+vpN3CxBDBaBrUr86AjYJV/UisLnnCCcRAy5OHL X-Received: by 10.236.93.38 with SMTP id k26mr2917121yhf.20.1396016574343; Fri, 28 Mar 2014 07:22:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.17.3 with SMTP id 3ls1433163qgc.83.gmail; Fri, 28 Mar 2014 07:22:54 -0700 (PDT) X-Received: by 10.58.57.42 with SMTP id f10mr7484936veq.1.1396016574232; Fri, 28 Mar 2014 07:22:54 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id sn5si1262558vdc.119.2014.03.28.07.22.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 07:22:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so5704304veb.4 for ; Fri, 28 Mar 2014 07:22:54 -0700 (PDT) X-Received: by 10.52.33.136 with SMTP id r8mr3389675vdi.2.1396016574137; Fri, 28 Mar 2014 07:22:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.12.8 with SMTP id v8csp12672vcv; Fri, 28 Mar 2014 07:22:51 -0700 (PDT) X-Received: by 10.180.189.169 with SMTP id gj9mr48364211wic.17.1396016571397; Fri, 28 Mar 2014 07:22:51 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id e3si1158683wic.76.2014.03.28.07.22.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Mar 2014 07:22:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; 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 Cc: patches@linaro.org, Kevin Wolf , Stefan Hajnoczi Subject: [PATCH 1/2] dma-helpers: Initialize DMAAIOCB in_cancel flag 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);