From patchwork Sat May 30 07:54:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49256 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 813D422B40 for ; Sat, 30 May 2015 08:00:32 +0000 (UTC) Received: by laat2 with SMTP id t2sf26131487laa.2 for ; Sat, 30 May 2015 01:00:31 -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=N+af6yx+4Mk7/tpxrfREa+HRRz8Iu0k+lGyvZ8FDSzQ=; b=NAfD73UGAxIaoxLvPqmV0uP5xy6bY7kQKskcmXZRlVDYs1ZllebqCpMit+UdfOouht yIw6kURdnoqRJsLh/5+Ba1WIrot4RKslnIVPT6Nr2idFRPMDgC4tyZ5mIBbqe/A7o1qK osWNaN981vAzfAfojl9+ea46n+quPMgreW1NdOH7MXGG/JGPgC+W672IXf1hxbI9IW0d gHrqsEIVAPguHPuFjasXZ3HrglJeaQTJbGRWdbExJp/ZyK3PvZ7s9Y9jWyn3twA2sujO c2wla9LzGaS6E03Cu4qWsK0DrZ8aBhEfJ18Mw4xZGfLnkV6mQEUBtoVSjDBna7HGiW4j Mqqg== X-Gm-Message-State: ALoCoQnExHaJBFOXqMu34AQWPKyXFry2zRAeCURgh/b9wN7z1GkfFyAzChBgHoaDnX8tKO2Sm4lb X-Received: by 10.194.202.229 with SMTP id kl5mr10848947wjc.3.1432972831466; Sat, 30 May 2015 01:00:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.164 with SMTP id cz4ls469646lac.3.gmail; Sat, 30 May 2015 01:00:31 -0700 (PDT) X-Received: by 10.112.164.66 with SMTP id yo2mr5044444lbb.33.1432972831334; Sat, 30 May 2015 01:00:31 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id jx2si6762238lbc.124.2015.05.30.01.00.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 May 2015 01:00:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbqq2 with SMTP id qq2so60567922lbb.3 for ; Sat, 30 May 2015 01:00:31 -0700 (PDT) X-Received: by 10.152.29.34 with SMTP id g2mr11764303lah.73.1432972831254; Sat, 30 May 2015 01:00:31 -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 hn6csp888779lbb; Sat, 30 May 2015 01:00:30 -0700 (PDT) X-Received: by 10.55.20.80 with SMTP id e77mr23867362qkh.30.1432972830006; Sat, 30 May 2015 01:00:30 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 8si8054188qgl.61.2015.05.30.01.00.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 30 May 2015 01:00:30 -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]:38663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yybgz-0005T7-AA for patch@linaro.org; Sat, 30 May 2015 04:00:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YybfE-00021G-DA for qemu-devel@nongnu.org; Sat, 30 May 2015 03:58:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YybfD-0000Z5-Cm for qemu-devel@nongnu.org; Sat, 30 May 2015 03:58:40 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:28724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yybf7-0000X5-Do; Sat, 30 May 2015 03:58:33 -0400 Received: from 172.24.2.119 (EHLO szxeml431-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BGU05481; Sat, 30 May 2015 15:55:11 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.158.1; Sat, 30 May 2015 15:55:04 +0800 From: Shannon Zhao To: Date: Sat, 30 May 2015 15:54:36 +0800 Message-ID: <1432972477-13504-7-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1432972477-13504-1-git-send-email-zhaoshenglong@huawei.com> References: <1432972477-13504-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.0A020203.55696CDF.00AE, 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: a0dc772afec6f99e8f9d52bf2a31bad0 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, peter.maydell@linaro.org, mjt@tls.msk.ru, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v2 6/7] hw/arm/spitz.c: Store irq array in MachineState to 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.217.179 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 Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/spitz.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 5bf032a..454919d 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -812,8 +812,8 @@ static void spitz_out_switch(void *opaque, int line, int level) #define SPITZ_SCP2_BACKLIGHT_ON 8 #define SPITZ_SCP2_MIC_BIAS 9 -static void spitz_scoop_gpio_setup(PXA2xxState *cpu, - DeviceState *scp0, DeviceState *scp1) +static qemu_irq *spitz_scoop_gpio_setup(PXA2xxState *cpu, + DeviceState *scp0, DeviceState *scp1) { qemu_irq *outsignals = qemu_allocate_irqs(spitz_out_switch, cpu, 8); @@ -828,6 +828,8 @@ static void spitz_scoop_gpio_setup(PXA2xxState *cpu, } qdev_connect_gpio_out(scp0, SPITZ_SCP_ADC_TEMP_ON, outsignals[6]); + + return outsignals; } #define SPITZ_GPIO_HSYNC 22 @@ -928,7 +930,7 @@ static void spitz_common_init(MachineState *machine, scp1 = sysbus_create_simple("scoop", 0x08800040, NULL); } - spitz_scoop_gpio_setup(mpu, scp0, scp1); + machine->irqs = spitz_scoop_gpio_setup(mpu, scp0, scp1); spitz_gpio_setup(mpu, (model == akita) ? 1 : 2);