]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
fixed ECC and Klocwork issues.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciResourceSupport.c
index d761832bf6b93c8092acaee3300838b2fa69ed1c..e7e40012c3b5dd9237c7c70ec704227edd93542b 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation\r
+Copyright (c) 2006 - 2009, 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
@@ -105,6 +105,9 @@ InsertResourceNode (
   UINT64            ResNodeAlignRest;\r
   UINT64            TempAlignRest;\r
 \r
+  ASSERT (Bridge  != NULL);\r
+  ASSERT (ResNode != NULL);\r
+\r
   InsertHeadList (&Bridge->ChildList, &ResNode->Link);\r
 \r
   CurrentLink = Bridge->ChildList.ForwardLink->ForwardLink;\r
@@ -160,6 +163,9 @@ MergeResourceTree (
   LIST_ENTRY        *CurrentLink;\r
   PCI_RESOURCE_NODE *Temp;\r
 \r
+  ASSERT (Dst != NULL);\r
+  ASSERT (Res != NULL);\r
+\r
   while (!IsListEmpty (&Res->ChildList)) {\r
     CurrentLink = Res->ChildList.ForwardLink;\r
 \r
@@ -1112,6 +1118,7 @@ ProgramBar (
   //\r
   Node->PciDev->Allocated = TRUE;\r
 \r
+  ASSERT (Node->Bar < PCI_MAX_BAR);\r
   switch ((Node->PciDev->PciBar[Node->Bar]).BarType) {\r
 \r
   case PciBarTypeIo16:\r