From patchwork Wed Jun 3 13:08:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 49461 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB56120BE7 for ; Wed, 3 Jun 2015 13:20:11 +0000 (UTC) Received: by wgez8 with SMTP id z8sf2636196wge.2 for ; Wed, 03 Jun 2015 06:20:11 -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:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=Op112HDn+zjyxgDFCOQrFyR8lZJLo2mTf5xdACINhgA=; b=fMaO+NRpGpbC0B7p/p5IjwJGIC4iBfF2iCeMyuiiWVfiKOJcU9d+8CAwVWseBU9H/E Gturo4QUJQCKep2Q6JgNFTr52hgZ0mrPKtpC8mo6xrJSmamKS9UmR72JsK6EcQespBNM LXuhCLr7txkInxR0wZVJvJgHTY+WpYkRrb3fHFKf9uhf0DhGpM/DVohMLun/PX72rPFS JNLBfvXHaVPwjczobfkhcN5PbzuaslUkd1TTW6hNvLNgVcP9CdJ1j/HQCOs0Ks/NNlk4 Ji6dmv6Ej/Synksjtn/SaEuSj5TckDuM/hQr0B71Ub7jEr5LBVxBSXq16Ism+fMy7vy7 R+kw== X-Gm-Message-State: ALoCoQn0eSfmbrLGr2ObBWti51rAKF2sRDVxRsU6ShBu7a9HZkU5NhzFKeSBX3CA6hnsFcCMIZ8L X-Received: by 10.112.84.104 with SMTP id x8mr30486335lby.23.1433337611223; Wed, 03 Jun 2015 06:20:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.51 with SMTP id o19ls51703laa.95.gmail; Wed, 03 Jun 2015 06:20:11 -0700 (PDT) X-Received: by 10.112.171.68 with SMTP id as4mr32026673lbc.64.1433337611079; Wed, 03 Jun 2015 06:20:11 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id p9si17990415laj.176.2015.06.03.06.20.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2015 06:20:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbqq2 with SMTP id qq2so6712926lbb.3 for ; Wed, 03 Jun 2015 06:20:11 -0700 (PDT) X-Received: by 10.112.220.7 with SMTP id ps7mr31440348lbc.72.1433337610996; Wed, 03 Jun 2015 06:20:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3863680lbb; Wed, 3 Jun 2015 06:20:09 -0700 (PDT) X-Received: by 10.229.237.1 with SMTP id km1mr37208320qcb.6.1433337609247; Wed, 03 Jun 2015 06:20:09 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w45si564261qgw.25.2015.06.03.06.20.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Jun 2015 06:20:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:35492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z08aW-0004b2-0w for patch@linaro.org; Wed, 03 Jun 2015 09:20:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z08XD-0006wb-Ap for qemu-devel@nongnu.org; Wed, 03 Jun 2015 09:16:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z08X5-0004Li-3O for qemu-devel@nongnu.org; Wed, 03 Jun 2015 09:16:43 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:53559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z08X4-0004Kk-RY; Wed, 03 Jun 2015 09:16:35 -0400 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 79B3D407A2; Wed, 3 Jun 2015 16:16:33 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id 52427A55; Wed, 3 Jun 2015 16:08:53 +0300 (MSK) Received: (nullmailer pid 27424 invoked by uid 1000); Wed, 03 Jun 2015 13:08:52 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Wed, 3 Jun 2015 16:08:26 +0300 Message-Id: <6e38a4ba7889083b65729db2144cdbcefbaa303a.1433336870.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Michael Tokarev , Shannon Zhao , Shannon Zhao Subject: [Qemu-devel] [PULL 06/30] hw/ide/pci: Fix memory leak 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mjt@tls.msk.ru X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Shannon Zhao valgrind complains about: ==16447== 16 bytes in 2 blocks are definitely lost in loss record 1,304 of 3,310 ==16447== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==16447== by 0x2E4FD7: malloc_and_trace (vl.c:2546) ==16447== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==16447== by 0x36FB47: qemu_extend_irqs (irq.c:55) ==16447== by 0x36FBD3: qemu_allocate_irqs (irq.c:64) ==16447== by 0x3B4B44: bmdma_init (pci.c:464) ==16447== by 0x3B547B: pci_piix_init_ports (piix.c:144) ==16447== by 0x3B55D2: pci_piix_ide_realize (piix.c:164) ==16447== by 0x3EAEC6: pci_qdev_realize (pci.c:1790) ==16447== by 0x36C685: device_set_realized (qdev.c:1058) ==16447== by 0x47179E: property_set_bool (object.c:1514) ==16447== by 0x470098: object_property_set (object.c:837) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Marcel Apfelbaum Signed-off-by: Michael Tokarev --- hw/ide/pci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 1b3d1c1..4b5e32d 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -452,8 +452,6 @@ static const struct IDEDMAOps bmdma_ops = { void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d) { - qemu_irq *irq; - if (bus->dma == &bm->dma) { return; } @@ -461,8 +459,7 @@ void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d) bm->dma.ops = &bmdma_ops; bus->dma = &bm->dma; bm->irq = bus->irq; - irq = qemu_allocate_irqs(bmdma_irq, bm, 1); - bus->irq = *irq; + bus->irq = qemu_allocate_irq(bmdma_irq, bm, 0); bm->pci_dev = d; }