Reviewed-by: S, Ashraf Ali <[email protected]> Thanks., S, Ashraf Ali
-----Original Message----- From: Ni, Ray <[email protected]> Sent: Thursday, March 14, 2024 8:22 AM To: [email protected]; Lin, Du <[email protected]> Cc: S, Ashraf Ali <[email protected]>; Chiu, Chasel <[email protected]>; Chen, Gang C <[email protected]>; Duggapu, Chinni B <[email protected]>; Desimone, Nathaniel L <[email protected]>; Zeng, Star <[email protected]>; Mohapatra, Susovan <[email protected]>; Kuo, Ted <[email protected]> Subject: RE: [edk2-devel] [PATCH v2] IntelFsp2WrapperPkg: Error handling of FspmWrapperInit() Reviewed-by: Ray Ni <[email protected]> Thanks, Ray > -----Original Message----- > From: [email protected] <[email protected]> On Behalf Of Du Lin > Sent: Thursday, March 14, 2024 10:02 AM > To: [email protected] > Cc: Lin, Du <[email protected]>; S, Ashraf Ali > <[email protected]>; Chiu, Chasel <[email protected]>; Chen, > Gang C <[email protected]>; Duggapu, Chinni B > <[email protected]>; Desimone, Nathaniel L > <[email protected]>; Zeng, Star <[email protected]>; > Mohapatra, Susovan <[email protected]>; Kuo, Ted > <[email protected]> > 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 <[email protected]> > Cc: Ashraf Ali S <[email protected]> > Cc: Chasel Chiu <[email protected]> > Cc: Chen Gang C <[email protected]> > Cc: Duggapu Chinni B <[email protected]> > Cc: Nate DeSimone <[email protected]> > Cc: Star Zeng <[email protected]> > Cc: Susovan Mohapatra <[email protected]> > Cc: Ted Kuo <[email protected]> > --- > 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 (#116733): https://edk2.groups.io/g/devel/message/116733 Mute This Topic: https://groups.io/mt/104919472/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
