The function header comments in lib header and C file should be updated as well to document a new condition when success is returned.
> -----Original Message----- > From: Tan, Dun <[email protected]> > Sent: Wednesday, March 8, 2023 6:08 PM > To: [email protected] > Cc: Dong, Eric <[email protected]>; Ni, Ray <[email protected]>; Kumar, > Rahul R <[email protected]>; Gerd Hoffmann <[email protected]> > Subject: [Patch V2 02/14] UefiCpuPkg/CpuPageTableLib: Add check for input > Length > > Add check for input Length in PageTableMap (). Return > RETURN_SUCCESS when input Length is 0. > > Signed-off-by: Dun Tan <[email protected]> > Cc: Eric Dong <[email protected]> > Cc: Ray Ni <[email protected]> > Cc: Rahul Kumar <[email protected]> > Cc: Gerd Hoffmann <[email protected]> > --- > UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c > b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c > index 47027917d9..4c9d70fa0a 100644 > --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c > +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c > @@ -567,6 +567,10 @@ PageTableMap ( > IA32_PAGE_LEVEL MaxLeafLevel; > IA32_MAP_ATTRIBUTE ParentAttribute; > > + if (Length == 0) { > + return RETURN_SUCCESS; > + } > + > if ((PagingMode == Paging32bit) || (PagingMode == PagingPae) || > (PagingMode >= PagingModeMax)) { > // > // 32bit paging is never supported. > -- > 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#101186): https://edk2.groups.io/g/devel/message/101186 Mute This Topic: https://groups.io/mt/97469467/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
