);\r
\r
if (Ehc->MemPool == NULL) {\r
- goto ErrorExit;\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ goto ErrorExit1;\r
}\r
\r
Status = EhcCreateHelpQ (Ehc);\r
return EFI_SUCCESS;\r
\r
ErrorExit:\r
- PciIo->FreeBuffer (PciIo, Pages, Buf);\r
- PciIo->Unmap (PciIo, Map);\r
-\r
if (Ehc->PeriodOne != NULL) {\r
UsbHcFreeMem (Ehc->MemPool, Ehc->PeriodOne, sizeof (EHC_QH));\r
Ehc->PeriodOne = NULL;\r
UsbHcFreeMem (Ehc->MemPool, Ehc->ShortReadStop, sizeof (EHC_QTD));\r
Ehc->ShortReadStop = NULL;\r
}\r
+\r
+ErrorExit1:\r
+ PciIo->FreeBuffer (PciIo, Pages, Buf);\r
+ PciIo->Unmap (PciIo, Map);\r
+\r
return Status;\r
}\r
\r
CurrentChildNode = CHILD_SECTION_NODE_FROM_LINK (GetFirstNode(&SourceStream->Children));\r
\r
for (;;) {\r
+ ASSERT (CurrentChildNode != NULL);\r
if (ChildIsType (SourceStream, CurrentChildNode, SearchType, SectionDefinitionGuid)) {\r
//\r
// The type matches, so check the instance count to see if it's the one we want\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- ASSERT (CurrentChildNode != NULL);\r
} else {\r
ASSERT (EFI_ERROR (ErrorStatus));\r
return ErrorStatus;\r
}\r
}\r
\r
+ ASSERT (Private->FvCount <= FixedPcdGet32 (PcdPeiCoreMaxFvSupported));\r
if (Instance >= Private->FvCount) {\r
return NULL;\r
}\r
{\r
PEI_CORE_UNKNOW_FORMAT_FV_INFO *NewUnknownFv;\r
\r
- if (PrivateData->UnknownFvInfoCount + 1 >= FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) {\r
+ if (PrivateData->UnknownFvInfoCount + 1 >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r