diff options
author | Dandan Bi <dandan.bi@intel.com> | 2018-02-07 09:00:17 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2018-05-10 14:23:03 +0800 |
commit | 7742a8dd23ec6366a9741d8ff9ab042ca8b21c62 (patch) | |
tree | faacf2959970ce439b28b48d08d33873afb248b8 | |
parent | 92cf6c91d04faca65bfc8000c8b2c9f556949ee4 (diff) | |
download | edk2-7742a8dd23ec6366a9741d8ff9ab042ca8b21c62.tar.gz edk2-7742a8dd23ec6366a9741d8ff9ab042ca8b21c62.tar.bz2 edk2-7742a8dd23ec6366a9741d8ff9ab042ca8b21c62.zip |
MdeModulePkg/PciBusDxe: Fix VS2012 build failure
Initialize local variable to suppress warning C4703:
potentially uninitialized local pointer variable.
Both reads (dereferences) of "PciRootBridgeIo" in
PciBusDriverBindingStart() are only reached if
"gFullEnumeration" is TRUE on entry *and* we successfully
open the EfiPciRootBridgeIoProtocol interface.
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit a012bf6e3e08d1fc878ffb271932e3cbce4a71f6)
-rw-r--r-- | MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c index c48e3bba96..a1654c0025 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c @@ -245,6 +245,11 @@ PciBusDriverBindingStart ( EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
//
+ // Initialize PciRootBridgeIo to suppress incorrect compiler warning.
+ //
+ PciRootBridgeIo = NULL;
+
+ //
// Check RemainingDevicePath validation
//
if (RemainingDevicePath != NULL) {
|