Minor bug fix and robustness check improvement.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10168 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -182,7 +182,8 @@ EhcInitSched (
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (Ehc->MemPool == NULL) {
|
if (Ehc->MemPool == NULL) {
|
||||||
goto ErrorExit;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
|
goto ErrorExit1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = EhcCreateHelpQ (Ehc);
|
Status = EhcCreateHelpQ (Ehc);
|
||||||
@ -223,9 +224,6 @@ EhcInitSched (
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
ErrorExit:
|
ErrorExit:
|
||||||
PciIo->FreeBuffer (PciIo, Pages, Buf);
|
|
||||||
PciIo->Unmap (PciIo, Map);
|
|
||||||
|
|
||||||
if (Ehc->PeriodOne != NULL) {
|
if (Ehc->PeriodOne != NULL) {
|
||||||
UsbHcFreeMem (Ehc->MemPool, Ehc->PeriodOne, sizeof (EHC_QH));
|
UsbHcFreeMem (Ehc->MemPool, Ehc->PeriodOne, sizeof (EHC_QH));
|
||||||
Ehc->PeriodOne = NULL;
|
Ehc->PeriodOne = NULL;
|
||||||
@ -240,6 +238,11 @@ ErrorExit:
|
|||||||
UsbHcFreeMem (Ehc->MemPool, Ehc->ShortReadStop, sizeof (EHC_QTD));
|
UsbHcFreeMem (Ehc->MemPool, Ehc->ShortReadStop, sizeof (EHC_QTD));
|
||||||
Ehc->ShortReadStop = NULL;
|
Ehc->ShortReadStop = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ErrorExit1:
|
||||||
|
PciIo->FreeBuffer (PciIo, Pages, Buf);
|
||||||
|
PciIo->Unmap (PciIo, Map);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -807,6 +807,7 @@ FindChildNode (
|
|||||||
CurrentChildNode = CHILD_SECTION_NODE_FROM_LINK (GetFirstNode(&SourceStream->Children));
|
CurrentChildNode = CHILD_SECTION_NODE_FROM_LINK (GetFirstNode(&SourceStream->Children));
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
ASSERT (CurrentChildNode != NULL);
|
||||||
if (ChildIsType (SourceStream, CurrentChildNode, SearchType, SectionDefinitionGuid)) {
|
if (ChildIsType (SourceStream, CurrentChildNode, SearchType, SectionDefinitionGuid)) {
|
||||||
//
|
//
|
||||||
// The type matches, so check the instance count to see if it's the one we want
|
// The type matches, so check the instance count to see if it's the one we want
|
||||||
@ -877,7 +878,6 @@ FindChildNode (
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
ASSERT (CurrentChildNode != NULL);
|
|
||||||
} else {
|
} else {
|
||||||
ASSERT (EFI_ERROR (ErrorStatus));
|
ASSERT (EFI_ERROR (ErrorStatus));
|
||||||
return ErrorStatus;
|
return ErrorStatus;
|
||||||
|
@ -1391,6 +1391,7 @@ FindNextCoreFvHandle (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ASSERT (Private->FvCount <= FixedPcdGet32 (PcdPeiCoreMaxFvSupported));
|
||||||
if (Instance >= Private->FvCount) {
|
if (Instance >= Private->FvCount) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1473,7 +1474,7 @@ AddUnknownFormatFvInfo (
|
|||||||
{
|
{
|
||||||
PEI_CORE_UNKNOW_FORMAT_FV_INFO *NewUnknownFv;
|
PEI_CORE_UNKNOW_FORMAT_FV_INFO *NewUnknownFv;
|
||||||
|
|
||||||
if (PrivateData->UnknownFvInfoCount + 1 >= FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) {
|
if (PrivateData->UnknownFvInfoCount + 1 >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user