Add some NULL pointer check by using ASSERT()

(based on FatPkg commit a60a7af0891419330e0080f23fd2586ec871f021)

[jordan.l.justen@intel.com: Use script to relicense to 2-clause BSD]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Mark Doran <mark.doran@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Qing Huang 2010-08-13 03:34:18 +00:00 committed by Jordan Justen
parent 4b9576aac0
commit 35053df36a
1 changed files with 2 additions and 1 deletions

View File

@ -1185,6 +1185,7 @@ Returns:
FAT_ODIR *ODir;
EFI_STATUS Status;
ASSERT (OFile != NULL);
ODir = OFile->ODir;
ASSERT (ODir != NULL);
DirEnt = AllocateZeroPool (sizeof (FAT_DIRENT));
@ -1376,8 +1377,8 @@ Returns:
FAT_VOLUME *Volume;
OFile = DirEnt->OFile;
Volume = OFile->Volume;
ASSERT (OFile != NULL);
Volume = OFile->Volume;
if (OFile->ODir != NULL) {
FatDiscardODir (OFile);