Revision: 18696
          http://sourceforge.net/p/edk2/code/18696
Author:   niruiyu
Date:     2015-10-29 03:26:00 +0000 (Thu, 29 Oct 2015)
Log Message:
-----------
MdeModulePkg: Do not dump NULL padding resource descriptor

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 <[email protected]>
Reviewed-by: Feng Tian <[email protected]>
Reviewed-by: Kinney Michael <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c

Modified: trunk/edk2/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c    
2015-10-29 01:13:59 UTC (rev 18695)
+++ trunk/edk2/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c    
2015-10-29 03:26:00 UTC (rev 18696)
@@ -340,6 +340,10 @@
   EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptor;
   PCI_BAR_TYPE                      Type;
 
+  if (PciIoDevice->ResourcePaddingDescriptors == NULL) {
+    return;
+  }
+
   if (ResourceType == PciBarTypeIo16 || ResourceType == PciBarTypeIo32) {
     ResourceType = PciBarTypeIo;
   }


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to