From patchwork Wed Jun 17 02:59:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49972 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6BC5C228F8 for ; Wed, 17 Jun 2015 03:04:56 +0000 (UTC) Received: by lbcak1 with SMTP id ak1sf9002071lbc.2 for ; Tue, 16 Jun 2015 20:04:55 -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=9JfrqUBKpBak5JfRr3klJwDb8mRIc24W2vUUQbW7fyE=; b=YNgyx03WJZQiLWPmSxsz+1gIdanJGbCTUkj3ichtHvBJFddPPeI0vOaGR5tKQDicOe kt9bCOOPcwEkpnOsFkGXPALKLbzAcGcwXWrMnQvYjvurU8hE6rV8AxyImqfPdjXLQuGk RYOqxxjoMnwIZhWE/XWp325qi9tmWXzaRSlDGTztY5zAY6jmf3gjkHGq5s/Tmm+s6Kbs 45FfREHTaaqlMWyL+6CdGP0eBjLI3sE6BXbIJAXwU1BpN9wHJXc+3R4CufwiDINy51o0 d2WcXY3MebDBfixeMa3INdkOlak7AxwrSYU5nYRJcxKmW0tO1e2D0Tg6m1/zj4DxF3yr a+Tw== X-Gm-Message-State: ALoCoQkw09NgvhT6ZommUepW2RdrMlu9xRBBimRU9JaLDSObGpEPmtkl3qm2HR2VCeHmz4y9Idn/ X-Received: by 10.112.188.233 with SMTP id gd9mr3438875lbc.12.1434510295361; Tue, 16 Jun 2015 20:04:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.168 with SMTP id w8ls238220lae.41.gmail; Tue, 16 Jun 2015 20:04:55 -0700 (PDT) X-Received: by 10.152.5.98 with SMTP id r2mr5511261lar.8.1434510295245; Tue, 16 Jun 2015 20:04:55 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id cq2si2247337lad.126.2015.06.16.20.04.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jun 2015 20:04:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by labko7 with SMTP id ko7so23649759lab.2 for ; Tue, 16 Jun 2015 20:04:55 -0700 (PDT) X-Received: by 10.112.41.196 with SMTP id h4mr5502152lbl.36.1434510295120; Tue, 16 Jun 2015 20:04:55 -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 hn6csp154638lbb; Tue, 16 Jun 2015 20:04:54 -0700 (PDT) X-Received: by 10.140.218.18 with SMTP id o18mr5330944qhb.30.1434510294032; Tue, 16 Jun 2015 20:04:54 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k75si3053169qhc.43.2015.06.16.20.04.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Jun 2015 20:04:54 -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]:43984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z53em-0006WX-NS for patch@linaro.org; Tue, 16 Jun 2015 23:04:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z53dt-0005cR-Kj for qemu-devel@nongnu.org; Tue, 16 Jun 2015 23:03:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z53ds-00070C-Kk for qemu-devel@nongnu.org; Tue, 16 Jun 2015 23:03:57 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:40364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z53dm-0006vX-GH; Tue, 16 Jun 2015 23:03:51 -0400 Received: from 172.24.2.119 (EHLO szxeml434-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CPP53201; Wed, 17 Jun 2015 11:00:32 +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:20 +0800 From: Shannon Zhao To: Date: Wed, 17 Jun 2015 10:59:55 +0800 Message-ID: <1434510002-6976-2-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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 58.251.152.64 Cc: qemu-trivial@nongnu.org, mjt@tls.msk.ru, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v3 1/8] include/hw/boards.h: Add a member in MachineState to store irq array 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.44 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 Here we add a member in MachineState to store the irq array returned from qemu_allocate_irqs. Then these irq arrays will be free before QEMU exit and it will be used to fix the memory leak due to misuse qemu_allocate_irqs. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- include/hw/boards.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/boards.h b/include/hw/boards.h index 6379901..0dea769 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -148,6 +148,7 @@ struct MachineState { char *initrd_filename; const char *cpu_model; AccelState *accelerator; + qemu_irq *irqs; }; #endif