From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.groups.io with SMTP id smtpd.web11.88.1610041446396648120 for ; Thu, 07 Jan 2021 09:44:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=QNj3OISJ; spf=pass (domain: nuviainc.com, ip: 209.85.128.41, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f41.google.com with SMTP id 3so6256946wmg.4 for ; Thu, 07 Jan 2021 09:44:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DKvdw0Lgy+awFV8vnjnM4zmjOQjbtDRUnBjsJih6dDM=; b=QNj3OISJtOHFepDhwI32OUNSQUKubosYZxXJcWiMa9qOQ8LgXGaccnv+zBTLvwqUKs x5eZkIHHYAvALtl7yfC/cJo43uNg4bu6gN1ZKEWnnbAoB27H/qo8HkVGTBSZZ327Dd7X GasUNwE3FiqSEXPoU32MmZK/RRMUr8gMLcucu2xWT4stnI4v4hS2OLG0+DbR21uS8K4F KTOV6ikbe+K7zBmtWM7KPvJzi0EEMT6cftKZc5cArB20x859jjLpPQkBBTWgXrjrjsGE 8CB1uipm+LT1fMEE+R0qw8hPrTMxhyJo2p7Z35BZ64SykedlskDHSabRlVGSJXY1rRk2 O+PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DKvdw0Lgy+awFV8vnjnM4zmjOQjbtDRUnBjsJih6dDM=; b=TiDng8J2csbcFdy4M/qF1PREgvv9WjCmQZrctT1qGDS+vSswmRqwcQrudoI0mVTQ0E p5ihMRtwOmUBt+E1mLwRNbsvRQglWtkcFWgAdOXXwl0n8TyVVBgPdsvhXfql5j318H8o 6JQ4/S56+4Iex+DTQ1BolAp7HBdxpN8Qi0yYRl6yHFtBWy9sAG5wba9Ak0LFsqnTpq/8 DbwjLxmuYyt/tz5AAzQnyk7hU/8RHaeSaJB6sQsN+0pQH+NFZWYiyU5Z5Ij4m94rAMBa frZrtB1KCAeTE/V4viEnmaYsbZg4pMkCcWEUYBiK9WKIjYuaAmeABEe4S5NSY1FjXyqQ cn+g== X-Gm-Message-State: AOAM532BhiZrxqTlB/78w/8lhsEAUnS9YFXjVoHIA0vGKjx+SB+QGXVD leo7baKITv/HR0Ztkk/K8qBTT40yWdn4dbl1 X-Google-Smtp-Source: ABdhPJwqFKT59KDskyo7y0lmq3TpZFxpANmFdzfcTRyrIXsboqtoagD7pLjzFdMGHWg3dy29FfpUwA== X-Received: by 2002:a1c:4e0a:: with SMTP id g10mr9001864wmh.51.1610041444979; Thu, 07 Jan 2021 09:44:04 -0800 (PST) Return-Path: Received: from vanye (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id v1sm8488224wmj.31.2021.01.07.09.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jan 2021 09:44:04 -0800 (PST) Date: Thu, 7 Jan 2021 17:44:02 +0000 From: "Leif Lindholm" To: Ard Biesheuvel Cc: devel@edk2.groups.io, gaoliming@byosoft.com.cn Subject: Re: [PATCH] EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob Message-ID: <20210107174402.GG1664@vanye> References: <20210106102925.9808-1-ard.biesheuvel@arm.com> MIME-Version: 1.0 In-Reply-To: <20210106102925.9808-1-ard.biesheuvel@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 06, 2021 at 11:29:25 +0100, Ard Biesheuvel wrote: > 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=3139 > 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/MemoryAllocationLib.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 { > > - Hob = (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL, (UINT16)(sizeof (EFI_HOB_TYPE_MEMORY_POOL) + AllocationSize)); > + Hob = (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL, > + (UINT16)(sizeof (EFI_HOB_MEMORY_POOL) + > + AllocationSize)); > return (VOID *)(Hob + 1); > } > } > -- > 2.17.1 >