]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Minor bug fix and robustness check improvement.
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 3 Mar 2010 09:40:16 +0000 (09:40 +0000)
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 3 Mar 2010 09:40:16 +0000 (09:40 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10168 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c
MdeModulePkg/Core/Pei/FwVol/FwVol.c

index 208620640498e55eb377bea6e3ea9dbdcfbcd6dd..d2e53300afb0fa82838a9a28daa003e6f36a08b7 100644 (file)
@@ -182,7 +182,8 @@ EhcInitSched (
                    );\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
@@ -223,9 +224,6 @@ EhcInitSched (
   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
@@ -240,6 +238,11 @@ ErrorExit:
     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
index d9fa20daa853aea3401a69920da77b6d1a2bafb8..7d4284057c0690e76013bd91b848b166760961d7 100644 (file)
@@ -807,6 +807,7 @@ FindChildNode (
   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
@@ -877,7 +878,6 @@ FindChildNode (
         if (EFI_ERROR (Status)) {\r
           return Status;\r
         }\r
-        ASSERT (CurrentChildNode != NULL);\r
       } else {\r
         ASSERT (EFI_ERROR (ErrorStatus));\r
         return ErrorStatus;\r
index 6892d22a429ae274f1d8a9cd76e69459eb92962b..276b6f979f3d01fdfeac5421109e1ac8a15acd5a 100644 (file)
@@ -1391,6 +1391,7 @@ FindNextCoreFvHandle (
     }\r
   }\r
 \r
+  ASSERT (Private->FvCount <= FixedPcdGet32 (PcdPeiCoreMaxFvSupported));\r
   if (Instance >= Private->FvCount) {\r
     return NULL;\r
   }\r
@@ -1473,7 +1474,7 @@ AddUnknownFormatFvInfo (
 {\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