From: "Ni, Ray" <ray.ni@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"Lin, Du" <du.lin@intel.com>
Cc: "S, Ashraf Ali" <ashraf.ali.s@intel.com>,
"Chiu, Chasel" <chasel.chiu@intel.com>,
"Chen, Gang C" <gang.c.chen@intel.com>,
"Duggapu, Chinni B" <chinni.b.duggapu@intel.com>,
"Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com>,
"Zeng, Star" <star.zeng@intel.com>,
"Mohapatra, Susovan" <susovan.mohapatra@intel.com>,
"Kuo, Ted" <ted.kuo@intel.com>
Subject: Re: [edk2-devel] [PATCH v2] IntelFsp2WrapperPkg: Error handling of FspmWrapperInit()
Date: Thu, 14 Mar 2024 02:52:24 +0000 [thread overview]
Message-ID: <MN6PR11MB8244EBDCD6D62330B138AB5C8C292@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)
In-Reply-To: <cbae36f3b8eb2484c2b2661da392e18e4ca68fac.1710381604.git.du.lin@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Thanks,
Ray
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Du Lin
> Sent: Thursday, March 14, 2024 10:02 AM
> To: devel@edk2.groups.io
> Cc: Lin, Du <du.lin@intel.com>; S, Ashraf Ali <ashraf.ali.s@intel.com>; Chiu,
> Chasel <chasel.chiu@intel.com>; Chen, Gang C <gang.c.chen@intel.com>;
> Duggapu, Chinni B <chinni.b.duggapu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>;
> Mohapatra, Susovan <susovan.mohapatra@intel.com>; Kuo, Ted
> <ted.kuo@intel.com>
> Subject: [edk2-devel] [PATCH v2] IntelFsp2WrapperPkg: Error handling of
> FspmWrapperInit()
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4701
>
> The error handling of FspmWrapperInit() is limited to ASSERT
> statements only, which only works in debug builds, but not in
> release builds.
> Fix the issue by enhancing the error handling of FspmWrapperInit()
> to cover both debug builds and release builds.
>
> Signed-off-by: Du Lin <du.lin@intel.com>
> Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Chen Gang C <gang.c.chen@intel.com>
> Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Susovan Mohapatra <susovan.mohapatra@intel.com>
> Cc: Ted Kuo <ted.kuo@intel.com>
> ---
> IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c | 8
> ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> index ba0c742fea..7f1deb9542 100644
> --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> @@ -197,12 +197,20 @@ FspmWrapperInit (
>
> MeasurementExcludedFvPpi = AllocatePool (sizeof
> (*MeasurementExcludedFvPpi));
> ASSERT (MeasurementExcludedFvPpi != NULL);
> + if (MeasurementExcludedFvPpi == NULL) {
> + return EFI_OUT_OF_RESOURCES;
> + }
> +
> MeasurementExcludedFvPpi->Count = 1;
> MeasurementExcludedFvPpi->Fv[0].FvBase = PcdGet32
> (PcdFspmBaseAddress);
> MeasurementExcludedFvPpi->Fv[0].FvLength =
> ((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32
> (PcdFspmBaseAddress))->FvLength;
>
> MeasurementExcludedPpiList = AllocatePool (sizeof
> (*MeasurementExcludedPpiList));
> ASSERT (MeasurementExcludedPpiList != NULL);
> + if (MeasurementExcludedPpiList == NULL) {
> + return EFI_OUT_OF_RESOURCES;
> + }
> +
> MeasurementExcludedPpiList->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI |
> EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
> MeasurementExcludedPpiList->Guid =
> &gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid;
> MeasurementExcludedPpiList->Ppi = MeasurementExcludedFvPpi;
> --
> 2.44.0.windows.1
>
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116726): https://edk2.groups.io/g/devel/message/116726
Mute This Topic: https://groups.io/mt/104919472/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-03-14 2:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-14 2:02 [edk2-devel] [PATCH v2] IntelFsp2WrapperPkg: Error handling of FspmWrapperInit() Du Lin
2024-03-14 2:52 ` Ni, Ray [this message]
2024-03-14 6:44 ` Ashraf Ali S
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MN6PR11MB8244EBDCD6D62330B138AB5C8C292@MN6PR11MB8244.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox