From patchwork Thu May 28 12:08:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49093 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4964C218EC for ; Thu, 28 May 2015 12:30:31 +0000 (UTC) Received: by lagv1 with SMTP id v1sf10695819lag.1 for ; Thu, 28 May 2015 05:30:30 -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=mMtUzATE14Ph9aHl1sFZL9Lu15sGLwUtoI6o9vwMWXk=; b=bNY+bY7c9ww+WiQE4wZtVCBgzjesnjcQncBVi3fjEo7L951oamVJkiraLmCJcmIPd5 oWqLlL6LqsWk7rywhZ1NKAuM1591A5AcvzHisioiAEgvtjnqNbz73vz7WE2xo74RPHHT W2zMsH020YwbhwDofCFJAoOMbBCyCKDqGmDjaM9exgyhxu6pqirfKw8e20DJJzq/5tgS /z3k8EuBm8b0hcRbq3VedWWROVpsry1jhm9ld/QZtLbwlf+2OizZDGdGmE0lltmgJT7T sbAku9I6ZGYRu5u+31CejlzRzJWwv3Vs3uD+dhWsBr1D8uuiyfCQeNScLgOlQx/8EgBJ zrsw== X-Gm-Message-State: ALoCoQmR74vnSwJNdr10zo1zNm2qQnl+B3jZPKumZ1mVfmqaM+ZVh/yIirELV8DlltCX0JcVcX0y X-Received: by 10.112.138.2 with SMTP id qm2mr2425025lbb.19.1432816229957; Thu, 28 May 2015 05:30:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.211 with SMTP id jq19ls196996lab.69.gmail; Thu, 28 May 2015 05:30:29 -0700 (PDT) X-Received: by 10.112.158.103 with SMTP id wt7mr2517545lbb.5.1432816229841; Thu, 28 May 2015 05:30:29 -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 pu2si1836073lbb.69.2015.05.28.05.30.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 05:30:29 -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 lagv1 with SMTP id v1so30373775lag.3 for ; Thu, 28 May 2015 05:30:29 -0700 (PDT) X-Received: by 10.152.44.166 with SMTP id f6mr2552566lam.86.1432816229576; Thu, 28 May 2015 05:30:29 -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 hn6csp1119624lbb; Thu, 28 May 2015 05:30:28 -0700 (PDT) X-Received: by 10.140.42.161 with SMTP id c30mr2800253qga.94.1432816228368; Thu, 28 May 2015 05:30:28 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 12si2200960qhx.61.2015.05.28.05.30.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 May 2015 05:30:28 -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]:58518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwx9-00061B-Dd for patch@linaro.org; Thu, 28 May 2015 08:30:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwgx-0007Sf-Bv for qemu-devel@nongnu.org; Thu, 28 May 2015 08:13:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yxwgt-0004iP-Jt for qemu-devel@nongnu.org; Thu, 28 May 2015 08:13:43 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:39917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwgs-0004hm-Fs; Thu, 28 May 2015 08:13:39 -0400 Received: from 172.24.2.119 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BGR93437; Thu, 28 May 2015 20:10:21 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.158.1; Thu, 28 May 2015 20:09:53 +0800 From: Shannon Zhao To: Date: Thu, 28 May 2015 20:08:25 +0800 Message-ID: <1432814932-12608-3-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1432814932-12608-1-git-send-email-zhaoshenglong@huawei.com> References: <1432814932-12608-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.556705AD.0214, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 584b8a628ee07c39fff2642251ff8a1f X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.66 Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, mjt@tls.msk.ru, shannon.zhao@linaro.org, peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH 02/29] hw/ide/cmd646.c: Fix memory leak spotted by valgrind 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: ==23215== 32 bytes in 2 blocks are definitely lost in loss record 1,356 of 2,329 ==23215== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==23215== by 0x27482B: malloc_and_trace (vl.c:2556) ==23215== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==23215== by 0x2EEFD3: qemu_extend_irqs (irq.c:55) ==23215== by 0x2EF05F: qemu_allocate_irqs (irq.c:64) ==23215== by 0x305498: pci_cmd646_ide_realize (cmd646.c:364) ==23215== by 0x33DB29: pci_qdev_realize (pci.c:1781) ==23215== by 0x2EBB14: device_set_realized (qdev.c:1058) ==23215== by 0x3C1A0E: property_set_bool (object.c:1514) ==23215== by 0x3C0308: object_property_set (object.c:837) ==23215== by 0x3C262A: object_property_set_qobject (qom-qobject.c:24) ==23215== by 0x3C0577: object_property_set_bool (object.c:905) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/ide/cmd646.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index 66fb9d9..c9703e2 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -370,6 +370,7 @@ static void pci_cmd646_ide_realize(PCIDevice *dev, Error **errp) d->bmdma[i].bus = &d->bus[i]; ide_register_restart_cb(&d->bus[i]); } + g_free(irq); vmstate_register(DEVICE(dev), 0, &vmstate_ide_pci, d); qemu_register_reset(cmd646_reset, d);