From patchwork Wed Jun 17 03:00:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49970 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 81AB9228F8 for ; Wed, 17 Jun 2015 03:04:32 +0000 (UTC) Received: by lagh6 with SMTP id h6sf9493866lag.0 for ; Tue, 16 Jun 2015 20:04: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=sSyLKitmeyhRH3MGJg/gz9QKTZxdQNWFjgXJqu/epRo=; b=Xc+bMehD+ydQBMFILrAjjatqS5qPF9O1Ll+A84+xOV9sg77TUmDVdJSI00XYAdhk8n Uobb4FRsG4RfPS6ckz5Rs5pLGkoUEp4JXMINhZ204VzY+lYcK3pyhrNNhUzS8kIYJL+U 3oTBJjF8ARYmNMWKbqPWxF6jJjOj0Vg4q67wB5mT387vRxQ3yEDMMXBv6Vy/Gz5XO5zL ENLwoYfhWYrGxv1Jqzpac+ZSlOSC/Twc91b7zr/eqlWiYy2KLJCczCEGelxG34RMI+yq PzXsKdj2lCJn6emNh8nGnt4dtLggzo4T9VbQ9Y3/FVfq7fpfZl4P22X9Iw8ef8QOTTm8 WZKA== X-Gm-Message-State: ALoCoQnqffh9ZrC82ZhsbRevx8OyZMWbjaBsud5FYu8A3YrdQmF6gKNt/9ht/7Xi9kLlC0vSQF80 X-Received: by 10.112.162.228 with SMTP id yd4mr3437864lbb.8.1434510271467; Tue, 16 Jun 2015 20:04:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.8.171 with SMTP id dl11ls224167lad.55.gmail; Tue, 16 Jun 2015 20:04:31 -0700 (PDT) X-Received: by 10.152.43.69 with SMTP id u5mr5182222lal.119.1434510271352; Tue, 16 Jun 2015 20:04:31 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id p5si2243689laj.137.2015.06.16.20.04.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jun 2015 20:04:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbti3 with SMTP id ti3so22642451lbb.1 for ; Tue, 16 Jun 2015 20:04:31 -0700 (PDT) X-Received: by 10.152.27.1 with SMTP id p1mr5383065lag.112.1434510271190; Tue, 16 Jun 2015 20:04: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 hn6csp154468lbb; Tue, 16 Jun 2015 20:04:30 -0700 (PDT) X-Received: by 10.55.18.27 with SMTP id c27mr816765qkh.84.1434510270010; Tue, 16 Jun 2015 20:04:30 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f1si3064222qcs.18.2015.06.16.20.04.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Jun 2015 20:04: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]:43982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z53eP-0005qb-4T for patch@linaro.org; Tue, 16 Jun 2015 23:04:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z53b4-0000vA-6u 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-0005yy-3p for qemu-devel@nongnu.org; Tue, 16 Jun 2015 23:01:01 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:52544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z53au-0005ky-4j; 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 BHU84679; 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:33 +0800 From: Shannon Zhao To: Date: Wed, 17 Jun 2015 11:00:02 +0800 Message-ID: <1434510002-6976-9-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.0A020201.5580E2DC.0061, 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: eb8d5cad52408c26c44469bebd299e39 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 8/8] hw/arm/tosa.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.172 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/tosa.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index 73572eb..4711514 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -85,10 +85,8 @@ static void tosa_out_switch(void *opaque, int line, int level) } -static void tosa_gpio_setup(PXA2xxState *cpu, - DeviceState *scp0, - DeviceState *scp1, - TC6393xbState *tmio) +static qemu_irq *tosa_gpio_setup(PXA2xxState *cpu, DeviceState *scp0, + DeviceState *scp1, TC6393xbState *tmio) { qemu_irq *outsignals = qemu_allocate_irqs(tosa_out_switch, cpu, 4); /* MMC/SD host */ @@ -117,6 +115,8 @@ static void tosa_gpio_setup(PXA2xxState *cpu, /* UDC Vbus */ qemu_irq_raise(qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_USB_IN)); + + return outsignals; } static uint32_t tosa_ssp_tansfer(SSISlave *dev, uint32_t value) @@ -238,7 +238,7 @@ static void tosa_init(MachineState *machine) scp0 = sysbus_create_simple("scoop", 0x08800000, NULL); scp1 = sysbus_create_simple("scoop", 0x14800040, NULL); - tosa_gpio_setup(mpu, scp0, scp1, tmio); + machine->irqs = tosa_gpio_setup(mpu, scp0, scp1, tmio); tosa_microdrive_attach(mpu);