]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Do not dump NULL padding resource descriptor
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 29 Oct 2015 03:26:00 +0000 (03:26 +0000)
committerniruiyu <niruiyu@Edk2>
Thu, 29 Oct 2015 03:26:00 +0000 (03:26 +0000)
Add a check for ResourcePaddingDescriptors being a valid pointer in
DumpPpbPaddingResource() to prevent looping on memory not owned by
PciBusDxe.  The ResourcePaddingDescriptors is initialized to NULL
when the PCI_IO_DEVICE structure is allocated and remains NULL if
no PCI hot plug controllers are present.  This issue is only
observed when DEBUG_CODE() macros are enabled and was introduced
by the following patch:

  [edk2] [Patch] MdeModulePkg: Fix a PciBusDxe hot plug bug
  SVN revsion 18658

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Kinney Michael <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18696 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c

index 030ef42320b85ffaee2c9c0f64c89c9dae43a9ad..a6ade26e3a09786970dc0a46fc0684d8e3c76a0a 100644 (file)
@@ -340,6 +340,10 @@ DumpPpbPaddingResource (
   EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptor;\r
   PCI_BAR_TYPE                      Type;\r
 \r
+  if (PciIoDevice->ResourcePaddingDescriptors == NULL) {\r
+    return;\r
+  }\r
+\r
   if (ResourceType == PciBarTypeIo16 || ResourceType == PciBarTypeIo32) {\r
     ResourceType = PciBarTypeIo;\r
   }\r