]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
fixed ECC and Klocwork issues.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciEnumeratorSupport.c
index ae5b7db8da8105797f8f4332c060a6df9ff4f13a..99e7a0b11dd377e8841efacd30b17b52ee3a1420 100644 (file)
@@ -362,7 +362,7 @@ GatherDeviceInfo (
   //\r
   // Start to parse the bars\r
   //\r
-  for (Offset = 0x10, BarIndex = 0; Offset <= 0x24; BarIndex++) {\r
+  for (Offset = 0x10, BarIndex = 0; Offset <= 0x24 && BarIndex < PCI_MAX_BAR; BarIndex++) {\r
     Offset = PciParseBar (PciIoDevice, Offset, BarIndex);\r
   }\r
 \r
@@ -1147,7 +1147,7 @@ UpdatePciInfo (
     }\r
   }\r
 \r
-  if (EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status) || Configuration == NULL ) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r