From patchwork Thu Jul 2 09:49:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 50557 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CAB56214B3 for ; Thu, 2 Jul 2015 09:53:38 +0000 (UTC) Received: by lagh6 with SMTP id h6sf18689455lag.0 for ; Thu, 02 Jul 2015 02:53:37 -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=4CMQ/ChdFDYJlwjMz8+bKq/JizOASY6x2H9nXWK0QFo=; b=D5y2h1+WFoJAxxDt8Vipuu/FQkqtXHMsZBRWhEvRJrKyGDPxMPWp+sxbUSOs+hsQ+0 CQYGO7GEWdzPNnQuDbTdz/mqjsJqcsOQl5T8cKcef+2C0FrxxoT8f+V4oATquulDlunR LkqqZSDHkny34fFkDO9VMZkXyUKVLe0+rTPfVscm9gDcpobGaTyhAssWK3T6sRdV7lzd CtF/Jtkg4GLrMwaA2pNKwJhQxZQh9JYckaxsLfXVCgQ/BkhL1UG9lxUbAimqLJiS0bZ4 dd6SR3cR8BljFDDct8KsP2kTqWoOtB4s22RGKwRVuavvLt1cyay8CP+8NsO5LBsMqUij aFtA== X-Gm-Message-State: ALoCoQmUfmoYpQieLHkfx7qbmlKlzivXohwytH+0WjKxiE72v9ZzYxST0QMkIT+sDEgunvk0fG+c X-Received: by 10.180.182.110 with SMTP id ed14mr4282904wic.5.1435830817780; Thu, 02 Jul 2015 02:53:37 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.194 with SMTP id v2ls343341lag.59.gmail; Thu, 02 Jul 2015 02:53:37 -0700 (PDT) X-Received: by 10.152.5.167 with SMTP id t7mr24287012lat.112.1435830817508; Thu, 02 Jul 2015 02:53:37 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id h8si4032699lbc.56.2015.07.02.02.53.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jul 2015 02:53:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbbpo10 with SMTP id po10so28642575lbb.3 for ; Thu, 02 Jul 2015 02:53:37 -0700 (PDT) X-Received: by 10.152.5.167 with SMTP id t7mr24287003lat.112.1435830817358; Thu, 02 Jul 2015 02:53:37 -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 hn6csp353815lbb; Thu, 2 Jul 2015 02:53:36 -0700 (PDT) X-Received: by 10.70.102.164 with SMTP id fp4mr21962481pdb.48.1435830815679; Thu, 02 Jul 2015 02:53:35 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id yl10si8201043pac.98.2015.07.02.02.53.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 02 Jul 2015 02:53:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:35632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAbBV-0005Lu-W4 for patch@linaro.org; Thu, 02 Jul 2015 05:53:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAb8L-0000Md-AA for qemu-devel@nongnu.org; Thu, 02 Jul 2015 05:50:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAb8K-0008Rn-DX for qemu-devel@nongnu.org; Thu, 02 Jul 2015 05:50:17 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:58098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAb8E-0008Nq-6G; Thu, 02 Jul 2015 05:50:10 -0400 Received: from 172.24.2.119 (EHLO szxeml428-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CNZ28159; Thu, 02 Jul 2015 17:50:04 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml428-hub.china.huawei.com (10.82.67.183) with Microsoft SMTP Server id 14.3.158.1; Thu, 2 Jul 2015 17:49:52 +0800 From: Shannon Zhao To: Date: Thu, 2 Jul 2015 17:49:21 +0800 Message-ID: <1435830563-3072-9-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1435830563-3072-1-git-send-email-zhaoshenglong@huawei.com> References: <1435830563-3072-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, mjt@tls.msk.ru, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH 08/10] hw/arm/tosa.c: Fix misusing qemu_allocate_irqs 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.174 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 Use qemu_allocate_irq instead of qemu_allocate_irqs to fix memory leak. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/tosa.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index 73572eb..6bfbc2b 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -90,7 +90,6 @@ static void tosa_gpio_setup(PXA2xxState *cpu, DeviceState *scp1, TC6393xbState *tmio) { - qemu_irq *outsignals = qemu_allocate_irqs(tosa_out_switch, cpu, 4); /* MMC/SD host */ pxa2xx_mmci_handlers(cpu->mmc, qdev_get_gpio_in(scp0, TOSA_GPIO_SD_WP), @@ -108,10 +107,14 @@ static void tosa_gpio_setup(PXA2xxState *cpu, qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_JC_CF_IRQ), NULL); - qdev_connect_gpio_out(scp1, TOSA_GPIO_BT_LED, outsignals[0]); - qdev_connect_gpio_out(scp1, TOSA_GPIO_NOTE_LED, outsignals[1]); - qdev_connect_gpio_out(scp1, TOSA_GPIO_CHRG_ERR_LED, outsignals[2]); - qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED, outsignals[3]); + qdev_connect_gpio_out(scp1, TOSA_GPIO_BT_LED, + qemu_allocate_irq(tosa_out_switch, cpu, 0)); + qdev_connect_gpio_out(scp1, TOSA_GPIO_NOTE_LED, + qemu_allocate_irq(tosa_out_switch, cpu, 1)); + qdev_connect_gpio_out(scp1, TOSA_GPIO_CHRG_ERR_LED, + qemu_allocate_irq(tosa_out_switch, cpu, 2)); + qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED, + qemu_allocate_irq(tosa_out_switch, cpu, 3)); qdev_connect_gpio_out(scp1, TOSA_GPIO_TC6393XB_L3V_ON, tc6393xb_l3v_get(tmio));