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 a012bf6e3e
)
This commit is contained in:
@@ -244,6 +244,11 @@ PciBusDriverBindingStart (
|
||||
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
|
||||
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
|
||||
|
||||
//
|
||||
// Initialize PciRootBridgeIo to suppress incorrect compiler warning.
|
||||
//
|
||||
PciRootBridgeIo = NULL;
|
||||
|
||||
//
|
||||
// Check RemainingDevicePath validation
|
||||
//
|
||||
|
Reference in New Issue
Block a user