From patchwork Sat May 30 07:54:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49251 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 5F96722B40 for ; Sat, 30 May 2015 07:56:45 +0000 (UTC) Received: by lbbti3 with SMTP id ti3sf24229889lbb.1 for ; Sat, 30 May 2015 00:56:44 -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=BTneEqLg6iCb4i+Qiu+jqNzb7aIYuhX5tAp21oaz7gZahLFW2ZIfS7U/DnimNKznA0 NjRgtBimROpXqpSRwKK2+79P6xOmdR+qsFzP5TAbai26yEbxNSkyytxKECjIPgmH2ft5 RmbRW6AqhxmkJmK4ACpSGUktDyaw0D/GDM//MbXaJFE/ZPiD7RxmrKQUpRS15LjBMFvO Avc/f1eOuxo4UwL1QGc5KZ7m6x7WUi0NoojFhDq01saNlDBRSoSEbsrNfXiWuurMnYy8 Z0OIAR7cKzqbcp9k97sXUWXNyxXISoHFDuIcjc2GTQpgI2AZuLYAUr1DjT8ShjyPGQiR h5sQ== X-Gm-Message-State: ALoCoQnHm7Q4ADIu/iZ/lrLh3Yg8VTBC5cepTzffL3/Lvk+KLfwnd3dD4ta3w4gs3AM5/Pw4qStg X-Received: by 10.113.11.3 with SMTP id ee3mr11047491lbd.9.1432972603694; Sat, 30 May 2015 00:56:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.36 with SMTP id g4ls464596lah.33.gmail; Sat, 30 May 2015 00:56:43 -0700 (PDT) X-Received: by 10.152.204.40 with SMTP id kv8mr11593100lac.113.1432972603428; Sat, 30 May 2015 00:56:43 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id bo7si6760042lbb.108.2015.05.30.00.56.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 May 2015 00:56:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lagv1 with SMTP id v1so70463807lag.3 for ; Sat, 30 May 2015 00:56:43 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr11530321lbc.41.1432972602992; Sat, 30 May 2015 00:56:42 -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 hn6csp886935lbb; Sat, 30 May 2015 00:56:41 -0700 (PDT) X-Received: by 10.140.151.131 with SMTP id 125mr14516860qhx.41.1432972600440; Sat, 30 May 2015 00:56:40 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n17si8023761qhb.104.2015.05.30.00.56.39 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 30 May 2015 00:56:40 -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]:38627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YybdH-0006qb-Ho for patch@linaro.org; Sat, 30 May 2015 03:56:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YybcM-0005nP-GD for qemu-devel@nongnu.org; Sat, 30 May 2015 03:55:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YybcL-0008Bq-EA for qemu-devel@nongnu.org; Sat, 30 May 2015 03:55:42 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:44108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YybcF-0008A0-U0; Sat, 30 May 2015 03:55:36 -0400 Received: from 172.24.2.119 (EHLO szxeml431-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CMD02174; Sat, 30 May 2015 15:55:16 +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:05 +0800 From: Shannon Zhao To: Date: Sat, 30 May 2015 15:54:37 +0800 Message-ID: <1432972477-13504-8-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-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, peter.maydell@linaro.org, mjt@tls.msk.ru, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v2 7/7] 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.215.42 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);