From patchwork Mon May 25 08:37:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48952 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 365F62121F for ; Mon, 25 May 2015 08:41:21 +0000 (UTC) Received: by wifx6 with SMTP id x6sf2054822wif.1 for ; Mon, 25 May 2015 01:41:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type: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=HSUHWipjnBNqOkM7L8nRvGjInF16ehrC4p+eqlUYPA4=; b=QZbUuo/lGwQXm0FMo1ph1+UnV5g5Db7vpWvkQNm2gaOIIpfGfBcIL9zWOoeXXHRGbe 0m1mWGiA2uqXHjFp6ukkIWif5mD+dX1wFmni93VlhYqaJHSvA9i492SllRMBrGtYQh3e dCZxuiXDA+Hi726zH/EbL9n7nlCUe0HhkzwyqQR8Y3p51y5Hgdze7OleAHGW0qLTp+nB y+ha+HIaEk8Owo4GzQdoIaD0ENmqSKrrbIyNUJrpSW3Eq7H5jZNNcECnOhmTp1tB9cuh Pw3lXh3lHSNz9rGlsc8G1w3BTsj9mbZxkWWqLEjDS/735jvnusS1dbIPzo3JYeahMKFH 8adw== X-Gm-Message-State: ALoCoQl94qTF/TzJukCxVzRPXg8sZC6JTouZXewotyf0dMspqLewMdCjerGhI1yO1qkCTtEiEhYd X-Received: by 10.112.171.41 with SMTP id ar9mr21509052lbc.24.1432543280481; Mon, 25 May 2015 01:41:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.195 with SMTP id g3ls783603lam.0.gmail; Mon, 25 May 2015 01:41:20 -0700 (PDT) X-Received: by 10.112.64.193 with SMTP id q1mr16990317lbs.11.1432543280364; Mon, 25 May 2015 01:41:20 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id h8si7925461lbc.56.2015.05.25.01.41.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 May 2015 01:41:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by labbd9 with SMTP id bd9so45458069lab.2 for ; Mon, 25 May 2015 01:41:20 -0700 (PDT) X-Received: by 10.152.6.69 with SMTP id y5mr17070975lay.72.1432543280253; Mon, 25 May 2015 01:41:20 -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 hn6csp1693892lbb; Mon, 25 May 2015 01:41:19 -0700 (PDT) X-Received: by 10.55.21.211 with SMTP id 80mr5030344qkv.11.1432543278859; Mon, 25 May 2015 01:41:18 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 11si46550qkr.34.2015.05.25.01.41.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 May 2015 01:41:18 -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]:42491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywnwk-0003JN-2Z for patch@linaro.org; Mon, 25 May 2015 04:41:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywnvn-0002Mq-2s for qemu-devel@nongnu.org; Mon, 25 May 2015 04:40:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ywnvj-0001HN-8k for qemu-devel@nongnu.org; Mon, 25 May 2015 04:40:18 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:22088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywnvb-0000vn-04; Mon, 25 May 2015 04:40:07 -0400 Received: from 172.24.2.119 (EHLO szxeml427-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CLV99022; Mon, 25 May 2015 16:39:57 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml427-hub.china.huawei.com (10.82.67.182) with Microsoft SMTP Server id 14.3.158.1; Mon, 25 May 2015 16:38:09 +0800 From: Shannon Zhao To: Date: Mon, 25 May 2015 16:37:56 +0800 Message-ID: <1432543077-12656-3-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1432543077-12656-1-git-send-email-zhaoshenglong@huawei.com> References: <1432543077-12656-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.65 Cc: qemu-trivial@nongnu.org, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH 2/3] 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: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 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 --- hw/ide/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 1b3d1c1..c5c4441 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -464,6 +464,7 @@ void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d) irq = qemu_allocate_irqs(bmdma_irq, bm, 1); bus->irq = *irq; bm->pci_dev = d; + g_free(irq); } static const TypeInfo pci_ide_type_info = {