From nobody Sat Nov 2 12:35:04 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; dkim=fail spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1491484578777906.4660225573547; Thu, 6 Apr 2017 06:16:18 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2D49721A0480E; Thu, 6 Apr 2017 06:16:15 -0700 (PDT) Received: from mail-wr0-x22c.google.com (mail-wr0-x22c.google.com [IPv6:2a00:1450:400c:c0c::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9833521A0480E for ; Thu, 6 Apr 2017 06:16:13 -0700 (PDT) Received: by mail-wr0-x22c.google.com with SMTP id t20so61702279wra.1 for ; Thu, 06 Apr 2017 06:16:13 -0700 (PDT) Received: from localhost.localdomain ([160.163.145.113]) by smtp.gmail.com with ESMTPSA id c8sm2087660wrd.57.2017.04.06.06.16.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Apr 2017 06:16:11 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FmqolnnYwGoGv5HaGK9zKXUVK4PFXtsvwaBl8IkU4mc=; b=O4pwHuD4J2ZxJ/mGGSFL+A5v82ooDj38Vmr7g7NaIpz4CFjKEf6V2Ja+MohjKUwmka eA2vzXq9p6yPWmKPeUVAEZ9fcYHoZjo6XHeQ7noUxzTEQSddr6Cm8ityfVcxRnyTlV39 UpZggFfAZAVat6ip6H63DRW6b3bIgfmDjttfc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FmqolnnYwGoGv5HaGK9zKXUVK4PFXtsvwaBl8IkU4mc=; b=Yeb8b6eLKMkc/QAo7LaBkU59Z2TmndgGqAsvwkQEtz5z9UUFlsWdNHAQ4nVYUmIMeu mTz1Vb3aT+E/1xt1Oq+nhs0Qymg5CWPg7neVElmSH3E0IzVeZhgWSnAyBJwL988110s5 Cl/gUSJHGbtWwGhKOVvdPWCW+aIhLWwx1Bn0IGa/bV0NaQplIpXe2LgzaLkpXp4jlgtu qBY3AIByiVsZbAiKhSa10wlrRKFsBDHl2vSZbXdBwyFIz/ql4MQkXV1oKdWbU5ELUtcP YxKgYD1Pdy+gWG+xYwvuizlHBRZeRGWPRtB5k+z6UkeESDUs2RrSgiguNeILvmf0hcx1 YtKg== X-Gm-Message-State: AFeK/H1906Tw8XlXFIUJE3K+2PMMKuoHFMe3qQwnePV2FzcNHRuMmCfOwbdB6BRGRsMQHGxj X-Received: by 10.223.171.84 with SMTP id r20mr28233947wrc.159.1491484572116; Thu, 06 Apr 2017 06:16:12 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, ryan.harkin@linaro.org, evan.lloyd@arm.com, jeremy.linton@arm.com Date: Thu, 6 Apr 2017 14:15:49 +0100 Message-Id: <20170406131551.3322-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170406131551.3322-1-ard.biesheuvel@linaro.org> References: <20170406131551.3322-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 3/5] ArmPlatformPkg/PL111LcdArmVExpressLib: fix incorrect FreePool () call X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When we fail to modify the memory attributes for the VRAM allocation, the allocation - which was made using AllocatePages() - is freed using FreePool(). This is incorrect by itself, but it masks a second bug, i.e., that the address of the allocation is not in VramBaseAddress but in *VramBaseAddress. So fix both issues. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVE= xpress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/P= L111LcdArmVExpress.c b/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVEx= pressLib/PL111LcdArmVExpress.c index 2000c9bdf436..a8125e81daac 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111Lcd= ArmVExpress.c +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111Lcd= ArmVExpress.c @@ -195,7 +195,7 @@ LcdPlatformGetVram ( Status =3D Cpu->SetMemoryAttributes(Cpu, *VramBaseAddress, *VramSize, = EFI_MEMORY_UC); ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { - gBS->FreePool(VramBaseAddress); + gBS->FreePages (*VramBaseAddress, EFI_SIZE_TO_PAGES(*VramSize)); return Status; } break; --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel