Refine code to make code more safely.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11123 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10 2010-12-06 09:14:47 +00:00
parent 8df0bd287c
commit 54790583c0
4 changed files with 4 additions and 4 deletions

View File

@ -149,7 +149,7 @@ Returns:
// Try to get the PEI version of ReportStatusCode.
//
Status = GetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **) &gReportStatusCode);
if (EFI_ERROR (Status)) {
if (EFI_ERROR (Status) || (gReportStatusCode == NULL)) {
return EFI_UNSUPPORTED;
}
}

View File

@ -700,7 +700,7 @@ Returns:
Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);
}
if (EFI_ERROR (Status)) {
if (EFI_ERROR (Status) || (HiiPackageList == NULL)) {
return Status;
}

View File

@ -958,7 +958,7 @@ ConstructConfigAltResp (
);
}
if (EFI_ERROR (Status)) {
if (EFI_ERROR (Status) || (ConfigHdr == NULL)) {
return Status;
}

View File

@ -930,7 +930,7 @@ Returns:
// Try to get the PEI version of ReportStatusCode.
//
Status = GetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **) &gReportStatusCode);
if (EFI_ERROR (Status)) {
if (EFI_ERROR (Status) || (gReportStatusCode == NULL)) {
return EFI_UNSUPPORTED;
}
}