From nobody Sat Nov 2 12:34:47 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 1491484575923454.6586364011745; Thu, 6 Apr 2017 06:16:15 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E405821DFA903; Thu, 6 Apr 2017 06:16:11 -0700 (PDT) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (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 2B29321A18AA9 for ; Thu, 6 Apr 2017 06:16:11 -0700 (PDT) Received: by mail-wm0-x229.google.com with SMTP id y18so14258wmh.0 for ; Thu, 06 Apr 2017 06:16:11 -0700 (PDT) Received: from localhost.localdomain ([160.163.145.113]) by smtp.gmail.com with ESMTPSA id c8sm2087660wrd.57.2017.04.06.06.16.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Apr 2017 06:16:09 -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=wBGxrj+uXaMQkdrtDV0kUgo4CGp2R4urP0FQkP5YUXY=; b=GJCNaUaDhwwyJ1EJCuolVcMB2uAslScngA9LgxTwWOtFr435TmuMvu4anOQP4tu4Ya BNy+b3/KRc+Pm8ihGF93Z9DLDoFYwhz2GJR/xcy/cOQW7ekeQ9xuegcsQGuvDhbH017w uN0XvEchpcK8m5x9amWic5IGDqTWVF6hc65wU= 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=wBGxrj+uXaMQkdrtDV0kUgo4CGp2R4urP0FQkP5YUXY=; b=hGiOfvpiHeenyALzgwaUM4DeJeOrrYabnvQBiJvHZ26vi4njKz4Gssln562ZssSvWb hPdCJ71GcFM4vtaI5cjIr8qLZVR9W+2fz4TnJ3ZaMSRewG7SAZ574u37GphFXLhvYuTq E5bZhTrx5wI//VI9jW2+wQJuJo12/xYUN/IB1Gx+AxCsOzSGTkcnbJ6BUlxYTZFLF48q JJxm0XvtVkWiS5MN2HmGQXv4yzMyZ8ELHNaQ9hbtB61Ydto6tj5WJbomWTh82MXVXfNY gxF9H66jH0t6t3XSgDuqLHdf6CEVoGDLvAueaZ4hpf+9vG69VtEosVcQ7OGGippq4PKC 5btQ== X-Gm-Message-State: AFeK/H29OHce7oyUbShv69xM995w+BGr/2QkGb9eiViR+5GYogXlwsUU1IpgqFKlOWnhf5Jn X-Received: by 10.28.66.74 with SMTP id p71mr24455603wma.131.1491484569782; Thu, 06 Apr 2017 06:16:09 -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:48 +0100 Message-Id: <20170406131551.3322-3-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 2/5] ArmPlatformPkg/HdLcdArmVExpressLib: 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/HdLcdArmVExpressLib/HdLcdArmVExpress= .c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/HdLc= dArmVExpress.c b/ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/= HdLcdArmVExpress.c index a57846715ed7..67b2f14beee3 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVEx= press.c +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVEx= press.c @@ -146,7 +146,7 @@ LcdPlatformGetVram ( Status =3D Cpu->SetMemoryAttributes (Cpu, *VramBaseAddress, *VramSize, E= FI_MEMORY_UC); ASSERT_EFI_ERROR(Status); if (EFI_ERROR(Status)) { - gBS->FreePool (VramBaseAddress); + gBS->FreePages (*VramBaseAddress, EFI_SIZE_TO_PAGES (*VramSize)); return Status; } =20 --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel