From patchwork Thu May 28 12:08:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49084 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3F477218EC for ; Thu, 28 May 2015 12:24:21 +0000 (UTC) Received: by lbcak1 with SMTP id ak1sf10122372lbc.2 for ; Thu, 28 May 2015 05:24:19 -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=cUwAXsomKZt5wvEg2+qemM3MLa45sWfyNNbT+TYEdFQ=; b=hD6V+N8F4gU15ygRvOb9KDI5DxgN9rkupLM3DqrY/0u2JRL+VxsvF6iu9pyEWP0qll M6WaE6Nf9ebU+iTZpgB1lRgqFOEr6N+ahD34Ss54rCqjZnnwy7XL/9jlkZgJw86qLYeI rFtR72NJAgtwIU5MUnW9TItbQbMbTwVnqvT9KZeTUL+PjIJPBtdFgNQBjNylYgET/5Iq nhofrb07pAW2v3sRJ62EHpvM3Eg3TOOxv7HZJMQpDYGhxs7pq4j9U44J3yvBHlhO7Un0 jE8nGDWMkNCRmFTfIkHTBI7aDfuxFObS0+F/E2vTWYguG7GTqqukumsi9UmblQBXn8jY 19vw== X-Gm-Message-State: ALoCoQlfXo0MTReIDMqq86UyirVL/NVIY3FHjyAN77tgquH7xLC0H9R6d0jePjjb4BbIJbHPsI7w X-Received: by 10.152.4.230 with SMTP id n6mr2504952lan.2.1432815859883; Thu, 28 May 2015 05:24:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.10 with SMTP id p10ls196404lag.29.gmail; Thu, 28 May 2015 05:24:19 -0700 (PDT) X-Received: by 10.152.29.234 with SMTP id n10mr2494045lah.101.1432815859755; Thu, 28 May 2015 05:24:19 -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 yf5si1811632lbb.113.2015.05.28.05.24.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 05:24:19 -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 lbcmx3 with SMTP id mx3so26995148lbc.1 for ; Thu, 28 May 2015 05:24:19 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr2519812laj.88.1432815859538; Thu, 28 May 2015 05:24:19 -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 hn6csp1115264lbb; Thu, 28 May 2015 05:24:18 -0700 (PDT) X-Received: by 10.55.16.165 with SMTP id 37mr4526833qkq.76.1432815858249; Thu, 28 May 2015 05:24:18 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l35si2182426qgd.62.2015.05.28.05.24.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 May 2015 05:24: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]:58435 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxwrB-0001nC-Bq for patch@linaro.org; Thu, 28 May 2015 08:24:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxwfQ-0004Ss-Nd for qemu-devel@nongnu.org; Thu, 28 May 2015 08:12:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxwfM-0004M9-UG for qemu-devel@nongnu.org; Thu, 28 May 2015 08:12:08 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:42475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxwfM-0004KH-D3; Thu, 28 May 2015 08:12:04 -0400 Received: from 172.24.2.119 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CMA92612; Thu, 28 May 2015 20:11:53 +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:10:19 +0800 From: Shannon Zhao To: Date: Thu, 28 May 2015 20:08:48 +0800 Message-ID: <1432814932-12608-26-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: 119.145.14.65 Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, mjt@tls.msk.ru, shannon.zhao@linaro.org, peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH 25/29] hw/arm/palm.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: ==27206== 56 bytes in 1 blocks are definitely lost in loss record 2,000 of 3,127 ==27206== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==27206== by 0x35479F: malloc_and_trace (vl.c:2556) ==27206== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==27206== by 0x3ED99B: qemu_extend_irqs (irq.c:55) ==27206== by 0x3EDA27: qemu_allocate_irqs (irq.c:64) ==27206== by 0x283C8B: palmte_gpio_setup (palm.c:168) ==27206== by 0x2840FA: palmte_init (palm.c:239) ==27206== by 0x358B6A: main (vl.c:4249) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/palm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/palm.c b/hw/arm/palm.c index 7f1cfb8..4e00695 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -173,6 +173,7 @@ static void palmte_gpio_setup(struct omap_mpu_state_s *cpu) qdev_connect_gpio_out(cpu->gpio, 13, misc_gpio[4]); omap_mpuio_out_set(cpu->mpuio, 1, misc_gpio[5]); omap_mpuio_out_set(cpu->mpuio, 3, misc_gpio[6]); + g_free(misc_gpio); /* Reset some inputs to initial state. */ qemu_irq_lower(qdev_get_gpio_in(cpu->gpio, PALMTE_USBDETECT_GPIO));