From patchwork Thu May 28 12:08:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49073 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C9159218EC for ; Thu, 28 May 2015 12:17:13 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf10057199lbb.0 for ; Thu, 28 May 2015 05:17:12 -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=RE3NmA3FsuPcaRXWx3nury2SVQVUWPDVLxgnu0yqoKQ=; b=frS8Xi4yp7ub6gOUWJUPv/cD3HsECV8dyYw2ktvivWMJzsAbDGCv1Rq01Km4awKlfh 4GIPjCDb6fALaRBvW09OliIoNcbXcqhPfTss0IoWujHrvfV9VKes7+gaHv1d3o/JQ43L mOG17l4oZkqVozSO9JF9Mn+OM9aWcPlFQ6nEYaTb1DZlIKpN/eNb7H/pnU3cnEVgRRga UVlQ+Ea1NccU5VKVKrGqDu2N9vNToaG47CElS5iBz7x8GqA3smzCVu0cGAoFfu/U+nPq +EnH486c/JgjrotSNA8wDxNQCtmTqFOpM5rC4Uiv8pkTcNnd+t6r0hmOCs7lHcWImRMs ysRA== X-Gm-Message-State: ALoCoQn7958xGge8t+XNIryUXOFjigZx0R4t5/uq0efYUMrUCwNiPTxV3EigGXiDMTAb4FI0AWhe X-Received: by 10.180.83.72 with SMTP id o8mr32954933wiy.3.1432815432755; Thu, 28 May 2015 05:17:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.137 with SMTP id o9ls168168lal.16.gmail; Thu, 28 May 2015 05:17:12 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr2550215lbh.56.1432815432610; Thu, 28 May 2015 05:17:12 -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 ot8si1778753lbb.177.2015.05.28.05.17.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 05:17:12 -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 lbcue7 with SMTP id ue7so26879965lbc.0 for ; Thu, 28 May 2015 05:17:12 -0700 (PDT) X-Received: by 10.152.4.72 with SMTP id i8mr2568074lai.32.1432815432342; Thu, 28 May 2015 05:17:12 -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 hn6csp1110057lbb; Thu, 28 May 2015 05:17:11 -0700 (PDT) X-Received: by 10.140.92.53 with SMTP id a50mr2758598qge.66.1432815431043; Thu, 28 May 2015 05:17:11 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g6si2161777qce.39.2015.05.28.05.17.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 May 2015 05:17:11 -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]:58355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxwkI-0004RP-3U for patch@linaro.org; Thu, 28 May 2015 08:17:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwe3-0002Ce-HP for qemu-devel@nongnu.org; Thu, 28 May 2015 08:10:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yxwdz-0003Vy-CS for qemu-devel@nongnu.org; Thu, 28 May 2015 08:10:43 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:45205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwdy-0003VC-O5; Thu, 28 May 2015 08:10:39 -0400 Received: from 172.24.2.119 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id COP98085; Thu, 28 May 2015 20:10:27 +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:52 +0800 From: Shannon Zhao To: Date: Thu, 28 May 2015 20:08:24 +0800 Message-ID: <1432814932-12608-2-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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 58.251.152.64 Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, mjt@tls.msk.ru, shannon.zhao@linaro.org, peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH 01/29] hw/ide/ahci.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.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: ==23381== 8 bytes in 1 blocks are definitely lost in loss record 438 of 2,785 ==23381== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==23381== by 0x35478F: malloc_and_trace (vl.c:2556) ==23381== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==23381== by 0x3ED98B: qemu_extend_irqs (irq.c:55) ==23381== by 0x3EDA17: qemu_allocate_irqs (irq.c:64) ==23381== by 0x43D767: ahci_init (ahci.c:1356) ==23381== by 0x43DAC5: sysbus_ahci_realize (ahci.c:1520) ==23381== by 0x3EA4CC: device_set_realized (qdev.c:1058) ==23381== by 0x516CD2: property_set_bool (object.c:1514) ==23381== by 0x5155CC: object_property_set (object.c:837) ==23381== by 0x5178EE: object_property_set_qobject (qom-qobject.c:24) ==23381== by 0x51583B: object_property_set_bool (object.c:905) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/ide/ahci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 9e5d862..4702a05 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1367,6 +1367,7 @@ void ahci_init(AHCIState *s, DeviceState *qdev, AddressSpace *as, int ports) ad->port.dma->ops = &ahci_dma_ops; ide_register_restart_cb(&ad->port); } + g_free(irqs); } void ahci_uninit(AHCIState *s)