From patchwork Thu Apr 2 03:07:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 46676 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 5B2FE2159A for ; Thu, 2 Apr 2015 03:09:04 +0000 (UTC) Received: by lbfb1 with SMTP id b1sf14389703lbf.2 for ; Wed, 01 Apr 2015 20:09:03 -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 :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=JCCk8tq7Zm/YNw12t5tAW3C2zLwj1FpmFLUxfG87bx8=; b=Q8PkBi5Y216e1b1Ve1/wjfT2pDsDi+b4Kx5AxB207YxoI91HuiXvWSlm+nhJ1NoyFj N+Nm2HhQKyiSuRBsvDWyt9qXVV1ewJYp+3qTW2cy2kBS7eDM5meKu6VjtAPf+BLeqvzR WKzjhswH5y2MEmawEjyLfIhDPlbwxVM2RXXELsvBNS7tLf31tNCPmOlPNz1NgDjYHLo4 o4i3EiiD+A6VRGtU6zVgZey1GwPqbrI6wXpRErNS07lm0jka9KNgZgx1gunFBukWYWim zMTBiN/ewWrlYg2GASkHUE1DQxAx91MSnCNv2GtsHcLscRcNSrLzvLQ/JK3Q6yllZQxv Vr9Q== X-Gm-Message-State: ALoCoQkftGXvOKyn0sRg1ivRWLZx13QUot6vTLnGNKZnZUmrYWwBLZ7fCEI8fixzNp8sPVQFJEC0 X-Received: by 10.112.148.10 with SMTP id to10mr10436688lbb.18.1427944143201; Wed, 01 Apr 2015 20:09:03 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.130 with SMTP id v2ls126417lae.98.gmail; Wed, 01 Apr 2015 20:09:03 -0700 (PDT) X-Received: by 10.152.88.1 with SMTP id bc1mr38796487lab.20.1427944142988; Wed, 01 Apr 2015 20:09:02 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id kv10si3090044lac.89.2015.04.01.20.09.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 20:09:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbzk7 with SMTP id zk7so33938032lbb.0 for ; Wed, 01 Apr 2015 20:09:02 -0700 (PDT) X-Received: by 10.152.178.197 with SMTP id da5mr39504208lac.56.1427944142243; Wed, 01 Apr 2015 20:09:02 -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.57.201 with SMTP id k9csp1054009lbq; Wed, 1 Apr 2015 20:09:01 -0700 (PDT) X-Received: by 10.55.52.77 with SMTP id b74mr38836498qka.78.1427944140957; Wed, 01 Apr 2015 20:09:00 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g65si3204042qkh.108.2015.04.01.20.09.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 Apr 2015 20:09:00 -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]:55760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdVV6-0005hB-1F for patch@linaro.org; Wed, 01 Apr 2015 23:09:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdVUf-0005Qh-0J for qemu-devel@nongnu.org; Wed, 01 Apr 2015 23:08:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YdVUa-0005Ed-NA for qemu-devel@nongnu.org; Wed, 01 Apr 2015 23:08:32 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:38766) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdVUa-0005E3-4g for qemu-devel@nongnu.org; Wed, 01 Apr 2015 23:08:28 -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 CJG79322; Thu, 02 Apr 2015 11:08: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; Thu, 2 Apr 2015 11:07:31 +0800 From: Shannon Zhao To: , , , Date: Thu, 2 Apr 2015 11:07:06 +0800 Message-ID: <1427944026-8968-1-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 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: hangaohuai@huawei.com, shannon.zhaol@linaro.org, peter.huangpeng@huawei.com, christoffer.dall@linaro.org Subject: [Qemu-devel] [PATCH] hw/arm/virt: Fix corruption due to double free 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.173 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 As 4de9a88(hw/arm/virt: Fix memory leak reported by Coverity) and 6e05a12(arm: fix memory leak) both handle the memory leak reported by Coverity, this cause qemu corruption due to double free. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/virt.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 7d082e2..febff22 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -572,7 +572,6 @@ static void create_flash(const VirtBoardInfo *vbi) error_report("Could not load ROM image '%s'", bios_name); exit(1); } - g_free(fn); } create_one_flash("virt.flash0", flashbase, flashsize);