From patchwork Wed Jun 17 03:00:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49973 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 691C4228F8 for ; Wed, 17 Jun 2015 03:05:59 +0000 (UTC) Received: by labsp1 with SMTP id sp1sf9503073lab.3 for ; Tue, 16 Jun 2015 20:05:58 -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=Ier8PWyRMe40yOJI6r5Qb9enemd5yUZuW2y2duUM/cRiHI46lkjUjTXPAfrfGpJiu2 r2bA8oCh4a0Omd2B85s9ed40HiBSD7ah71PNRo76WM+W8bd3htvlTCf0KYkQoKjuRp2Q EzGi9KGlHs5Xc3KAM1kWPe7HUfOH7udpOVN1cLxaxs2W/VdWo6b+J8PpktFpQyURb1ZU p+rcu71e59cVNF4NjRBn3yuGrdQnsrC6vtzFADORmqgmAnni99XXz3eSJTmqNsR7gkum 2vdS1kC/lBDe4KbntHuQapGMvviKBmOgRzTm2PbKJ37EmeZ1kNhDTl3F6LpBUlBOR/Ir d9YQ== X-Gm-Message-State: ALoCoQkrpu6QeYRyb9tCwUw9UC7spKBoOy8sx9v1BK+LAduF9MJNVfb5cdrNIcqwZIoZSkoBLLAB X-Received: by 10.112.210.162 with SMTP id mv2mr3376159lbc.15.1434510358399; Tue, 16 Jun 2015 20:05:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.41 with SMTP id bd9ls238075lab.109.gmail; Tue, 16 Jun 2015 20:05:58 -0700 (PDT) X-Received: by 10.112.180.201 with SMTP id dq9mr5559824lbc.78.1434510358285; Tue, 16 Jun 2015 20:05:58 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id ot8si2239371lbb.177.2015.06.16.20.05.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jun 2015 20:05:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by labbc20 with SMTP id bc20so23581110lab.1 for ; Tue, 16 Jun 2015 20:05:58 -0700 (PDT) X-Received: by 10.152.44.166 with SMTP id f6mr5487053lam.86.1434510358146; Tue, 16 Jun 2015 20:05:58 -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 hn6csp155063lbb; Tue, 16 Jun 2015 20:05:57 -0700 (PDT) X-Received: by 10.140.233.82 with SMTP id e79mr5245401qhc.83.1434510356969; Tue, 16 Jun 2015 20:05:56 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g196si3045246qhc.80.2015.06.16.20.05.56 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Jun 2015 20:05:56 -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]:43994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z53fn-0008S9-Rw for patch@linaro.org; Tue, 16 Jun 2015 23:05:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z53b4-0000vC-7u for qemu-devel@nongnu.org; Tue, 16 Jun 2015 23:01:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z53b2-0005z3-4Q for qemu-devel@nongnu.org; Tue, 16 Jun 2015 23:01:01 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:52538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z53at-0005jH-Gq; Tue, 16 Jun 2015 23:00:52 -0400 Received: from 172.24.2.119 (EHLO szxeml434-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BHU84678; Wed, 17 Jun 2015 11:00:43 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml434-hub.china.huawei.com (10.82.67.225) with Microsoft SMTP Server id 14.3.158.1; Wed, 17 Jun 2015 11:00:32 +0800 From: Shannon Zhao To: Date: Wed, 17 Jun 2015 11:00:01 +0800 Message-ID: <1434510002-6976-8-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1434510002-6976-1-git-send-email-zhaoshenglong@huawei.com> References: <1434510002-6976-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.0A020205.5580E2DB.013C, 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: 33f1fb6f1ee2bdcffefeffe32e744cc9 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, mjt@tls.msk.ru, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v3 7/8] 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.215.53 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);