From patchwork Thu Jul 2 09:49:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 50560 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 D8EB7214B3 for ; Thu, 2 Jul 2015 09:55:29 +0000 (UTC) Received: by lagx9 with SMTP id x9sf18705577lag.2 for ; Thu, 02 Jul 2015 02:55:28 -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=EjJ+JJ3/HtdAyU6wxFiD9KeQnLBcG3gZEMKpVyhMsHM=; b=KZybAfO39KF4hX3vIgUlM0833a9L+YisGSUmTUFAUKCjv2HENUl1P7TYAmA/ihBF1j /jl2AV7pK24X8iLcplFl3ADctZRTntGFy6h7S5F6G14AkEYNe2RBAH5AYFSMJ0aO94Iv alyKJjcvYz30HjWAJQ+qAGaRhkximJ1KJ8Ppz8M3pxkRlbh7vcGPcAIIXfPxNP/tuEit 5TlQNCfTubc96ZMGBkZRrjDVb1EWdLPkR62KNS39gvNm4uTm/AFp//vwUybgVKiGprcI WTEcdO2tt7vS6JxjUQJSTbs0O4ZopaNg1qYq8qwLtwBT1NF7vu06ClDQCcQ2PmFVIZMs bLVA== X-Gm-Message-State: ALoCoQnyMe3bOAlwnOm84nrDhPMel7QchnU1eWhDzGCAWXKi78hLq564VpU198S5vXDfDfBf9VJe X-Received: by 10.180.189.50 with SMTP id gf18mr17340002wic.3.1435830928798; Thu, 02 Jul 2015 02:55:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.18 with SMTP id s18ls315452lal.63.gmail; Thu, 02 Jul 2015 02:55:28 -0700 (PDT) X-Received: by 10.152.7.239 with SMTP id m15mr28737102laa.95.1435830928416; Thu, 02 Jul 2015 02:55:28 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id t2si4005613lbj.163.2015.07.02.02.55.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jul 2015 02:55:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbnk3 with SMTP id k3so28691042lbn.1 for ; Thu, 02 Jul 2015 02:55:28 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr28914155lbc.41.1435830928171; Thu, 02 Jul 2015 02:55:28 -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 hn6csp354875lbb; Thu, 2 Jul 2015 02:55:27 -0700 (PDT) X-Received: by 10.70.102.11 with SMTP id fk11mr63998394pdb.144.1435830926519; Thu, 02 Jul 2015 02:55:26 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id fm2si8230109pbc.35.2015.07.02.02.55.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 02 Jul 2015 02:55:26 -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]:35650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAbDI-0000Gr-MY for patch@linaro.org; Thu, 02 Jul 2015 05:55:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAb8L-0000O9-SJ 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-0008SB-UQ for qemu-devel@nongnu.org; Thu, 02 Jul 2015 05:50:17 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:58165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAb8F-0008Or-TK; Thu, 02 Jul 2015 05:50:12 -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 CNZ28161; 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:55 +0800 From: Shannon Zhao To: Date: Thu, 2 Jul 2015 17:49:23 +0800 Message-ID: <1435830563-3072-11-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 10/10] hw/openrisc/pic_cpu.c: use qemu_allocate_irq 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.171 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/openrisc/pic_cpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/openrisc/pic_cpu.c b/hw/openrisc/pic_cpu.c index 2af1d60..5060214 100644 --- a/hw/openrisc/pic_cpu.c +++ b/hw/openrisc/pic_cpu.c @@ -51,10 +51,8 @@ static void openrisc_pic_cpu_handler(void *opaque, int irq, int level) void cpu_openrisc_pic_init(OpenRISCCPU *cpu) { int i; - qemu_irq *qi; - qi = qemu_allocate_irqs(openrisc_pic_cpu_handler, cpu, NR_IRQS); for (i = 0; i < NR_IRQS; i++) { - cpu->env.irq[i] = qi[i]; + cpu->env.irq[i] = qemu_allocate_irq(openrisc_pic_cpu_handler, cpu, i); } }