ShellPkg/pci: Fix VS2012 build failure
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 20 Apr 2017 02:17:16 +0000 (10:17 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 20 Apr 2017 03:04:50 +0000 (11:04 +0800)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c

index 99335f0..3855957 100644 (file)
@@ -2885,6 +2885,7 @@ ShellCommandRunPci (
      );\r
 \r
     ExtendedConfigSpace = NULL;\r
+    ExtendedConfigSize  = 0;\r
     PcieCapabilityPtr = LocatePciCapability (&ConfigSpace, EFI_PCI_CAPABILITY_ID_PCIEXP);\r
     if (PcieCapabilityPtr != 0) {\r
       ExtendedConfigSize  = 0x1000 - EFI_PCIE_CAPABILITY_BASE_OFFSET;\r
@@ -2922,7 +2923,7 @@ ShellCommandRunPci (
     //\r
     if (ExplainData) {\r
       PciExplainPci (&ConfigSpace, Address, IoDev);\r
-      if ((PcieCapabilityPtr != 0) && !ShellGetExecutionBreakFlag ()) {\r
+      if ((ExtendedConfigSpace != NULL) && !ShellGetExecutionBreakFlag ()) {\r
         PciExplainPciExpress (\r
           (PCI_CAPABILITY_PCIEXP *) ((UINT8 *) &ConfigSpace + PcieCapabilityPtr),\r
           ExtendedConfigSpace,\r