FvIsBeingProcesssed (FvHandle);\r
\r
Status = CoreHandleProtocol (FvHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv);\r
- if (EFI_ERROR (Status)) {\r
+ if (EFI_ERROR (Status) || Fv == NULL) {\r
//\r
// FvHandle must have Firmware Volume2 protocol thus we should never get here.\r
//\r
Layers on top of Firmware Block protocol to produce a file abstraction\r
of FV based files.\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. <BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
if (EFI_ERROR (Status)) {\r
return;\r
}\r
+ ASSERT (FwVolHeader != NULL);\r
\r
if (!VerifyFvHeaderChecksum (FwVolHeader)) {\r
CoreFreePool (FwVolHeader);\r
The GCD services are used to manage the memory and I/O regions that\r
are accessible to the CPU that is executing the DXE core.\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. <BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
goto Done;\r
}\r
+ ASSERT (StartLink != NULL && EndLink != NULL);\r
\r
//\r
// Verify that the list of descriptors are unallocated non-existent memory.\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Done;\r
}\r
+ ASSERT (TopEntry != NULL && BottomEntry != NULL);\r
\r
if (Operation == GCD_SET_ATTRIBUTES_MEMORY_OPERATION) {\r
//\r
CpuArchAttributes = ConverToCpuArchAttributes (Attributes);\r
if ( CpuArchAttributes != INVALID_CPU_ARCH_ATTRIBUTES ) {\r
Status = CoreLocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&CpuArch);\r
- if (EFI_ERROR (Status)) {\r
+ if (EFI_ERROR (Status) || CpuArch == NULL) {\r
Status = EFI_ACCESS_DENIED;\r
goto Done;\r
}\r
Status = EFI_NOT_FOUND;\r
goto Done;\r
}\r
+ ASSERT (StartLink != NULL && EndLink != NULL);\r
\r
//\r
// Verify that the list of descriptors are unallocated memory matching GcdMemoryType.\r
Status = EFI_NOT_FOUND;\r
goto Done;\r
}\r
+ ASSERT (StartLink != NULL && EndLink != NULL);\r
\r
Link = StartLink;\r
//\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Done;\r
}\r
+ ASSERT (TopEntry != NULL && BottomEntry != NULL);\r
\r
//\r
// Convert/Insert the list of descriptors from StartLink to EndLink\r
if (EFI_ERROR (Status)) {\r
Status = EFI_NOT_FOUND;\r
} else {\r
+ ASSERT (StartLink != NULL && EndLink != NULL);\r
//\r
// Copy the contents of the found descriptor into Descriptor\r
//\r
if (EFI_ERROR (Status)) {\r
Status = EFI_NOT_FOUND;\r
} else {\r
+ ASSERT (StartLink != NULL && EndLink != NULL);\r
//\r
// Copy the contents of the found descriptor into Descriptor\r
//\r
/** @file\r
Support functions to connect/disconnect UEFI Driver model Protocol\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. <BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
&gEfiDriverBindingProtocolGuid,\r
(VOID **)&DriverBinding\r
);\r
- if (EFI_ERROR (Status)) {\r
+ if (EFI_ERROR (Status) || DriverBinding == NULL) {\r
Status = EFI_INVALID_PARAMETER;\r
goto Done;\r
}\r
/** @file\r
Locate handle functions\r
\r
-Copyright (c) 2006 - 2009, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. <BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
return Status;\r
}\r
\r
+ ASSERT (GetNext != NULL);\r
//\r
// Enumerate out the matching handles\r
//\r
// If this is a search by register notify and a handle was\r
// returned, update the register notification position\r
//\r
+ ASSERT (SearchKey != NULL);\r
ProtNotify = SearchKey;\r
ProtNotify->Position = ProtNotify->Position->ForwardLink;\r
}\r
/** @file\r
Core image handling services to load and unload PeImage.\r
\r
-Copyright (c) 2006 - 2009, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. <BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
// Locate the EBC interpreter protocol\r
//\r
Status = CoreLocateProtocol (&gEfiEbcProtocolGuid, NULL, (VOID **)&Image->Ebc);\r
- if (EFI_ERROR(Status)) {\r
+ if (EFI_ERROR(Status) || Image->Ebc == NULL) {\r
DEBUG ((DEBUG_LOAD | DEBUG_ERROR, "CoreLoadPeImage: There is no EBC interpreter for an EBC image.\n"));\r
goto Done;\r
}\r
// Pull out just the file portion of the DevicePath for the LoadedImage FilePath\r
//\r
FilePath = OriginalFilePath;\r
- Status = CoreHandleProtocol (DeviceHandle, &gEfiDevicePathProtocolGuid, (VOID **)&HandleFilePath);\r
- if (!EFI_ERROR (Status)) {\r
- FilePathSize = GetDevicePathSize (HandleFilePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);\r
- FilePath = (EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *)FilePath) + FilePathSize );\r
+ if (DeviceHandle != NULL) {\r
+ Status = CoreHandleProtocol (DeviceHandle, &gEfiDevicePathProtocolGuid, (VOID **)&HandleFilePath);\r
+ if (!EFI_ERROR (Status)) {\r
+ FilePathSize = GetDevicePathSize (HandleFilePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);\r
+ FilePath = (EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *)FilePath) + FilePathSize );\r
+ }\r
}\r
-\r
//\r
// Initialize the fields for an internal driver\r
//\r
3) A support protocol is not found, and the data is not available to be read\r
without it. This results in EFI_PROTOCOL_ERROR.\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. <BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
GuidedHeader = (EFI_GUID_DEFINED_SECTION *) SectionHeader;\r
Node->EncapsulationGuid = &GuidedHeader->SectionDefinitionGuid;\r
Status = CoreLocateProtocol (Node->EncapsulationGuid, NULL, (VOID **)&GuidedExtraction);\r
- if (!EFI_ERROR (Status)) {\r
+ if (!EFI_ERROR (Status) && GuidedExtraction != NULL) {\r
//\r
// NewStreamBuffer is always allocated by ExtractSection... No caller\r
// allocation here.\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
+ ASSERT (CurrentChildNode != NULL);\r
} else {\r
ASSERT (EFI_ERROR (ErrorStatus));\r
return ErrorStatus;\r
If one of them is not satisfied, FtwWrite may fail.\r
Usually, Spare area only takes one block. That's SpareAreaLength = BlockSize, NumberOfSpareBlock = 1.\r
\r
-Copyright (c) 2006 - 2009, Intel Corporation \r
+Copyright (c) 2006 - 2010, Intel Corporation \r
All rights reserved. This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
*Complete = TRUE;\r
return EFI_NOT_FOUND;\r
}\r
+ ASSERT (Record != NULL);\r
}\r
\r
//\r