From nobody Wed Apr 24 13:06:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+69807+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+69807+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1609929001; cv=none; d=zohomail.com; s=zohoarc; b=GwLeKtGqKwqUwhWAlQhMXK4a7rGiKFN7h+DNx0CJlZm6YIB43Aeb0zBqsfLBHKeUCU2au9EjAVff5V58JtMpziHevysP9ewD9OdzHlrt14jpiFp1kk64TfW71WyofT7thIg9iC9xvV4kldBHfDtFa5XG2w4mi9kgFtjJyeE781M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609929001; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=KpNqsb+4Nx+fhP5Yuq9DAXBMZXXUZAIC92b5pHUELHo=; b=TIbxWyktVMmbwogiK8ws0ZSQqqWk19VP0eIbG1kCppKxf719HtL/CTYJUuvCbplCHoJHQLSu3tGtBtPLVdW2tf389wfFLOFKby8quoHK9SF+L0cel2cGESEFkpsO7f6qZpNzjPpD46APd6aVGvYeJIUs8A/2HbvY+AEMLV9podQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+69807+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1609929001067189.85621414801403; Wed, 6 Jan 2021 02:30:01 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id CFnUYY1788612xBH4hrDrqMi; Wed, 06 Jan 2021 02:30:00 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6057.1609928999893048183 for ; Wed, 06 Jan 2021 02:30:00 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C0B2F1FB; Wed, 6 Jan 2021 02:29:58 -0800 (PST) X-Received: from e123331-lin.nice.arm.com (unknown [10.37.8.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C8B993F719; Wed, 6 Jan 2021 02:29:57 -0800 (PST) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: gaoliming@byosoft.com.cn, leif@nuviainc.com, Ard Biesheuvel Subject: [edk2-devel] [PATCH] EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob Date: Wed, 6 Jan 2021 11:29:25 +0100 Message-Id: <20210106102925.9808-1-ard.biesheuvel@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@arm.com X-Gm-Message-State: VQaVslch6qLcJlJw8IEupTPqx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1609929000; bh=wZ/gH+G1Y7EXuwdeIDiFeoJHc0fToLXW+Vyc9BoaXLk=; h=Cc:Date:From:Reply-To:Subject:To; b=iTuCapVq40sQXLzOxoDFPtO7pEcaot+omQVcoMEoPJqAGxf/ZWjWE3Zgj3K7qthOigJ lw491nePOZxEo6CqSFq9Vbfjix7Sv5IMJl9Ot4OBu4ls13W0zJE5HEyyAaMnhkfs+x6Kq izqy4Se6KNHejnLl37WwXQYXe3ntafoL4RA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use the correct type in the sizeof() expression to calculate the size of the newly allocated EFI_HOB_MEMORY_POOL hob. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3139 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationL= ib.c b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c index 6d233acb98d7..bae6682c72b6 100644 --- a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c +++ b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c @@ -184,7 +184,9 @@ AllocatePool ( return 0; } else { =20 - Hob =3D (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL, (U= INT16)(sizeof (EFI_HOB_TYPE_MEMORY_POOL) + AllocationSize)); + Hob =3D (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL, + (UINT16)(sizeof (EFI_HOB_MEMORY_POOL) + + AllocationSize)); return (VOID *)(Hob + 1); } } --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#69807): https://edk2.groups.io/g/devel/message/69807 Mute This Topic: https://groups.io/mt/79472089/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-