PcAtChipsetPkg/IsaAcpiDxe: Fix VS2012 build failure

Done:
if (EFI_ERROR (Status)) {
  if (PciIo != NULL && Enabled) {
    PciIo->Attributes (
             PciIo,
             EfiPciIoAttributeOperationSet,
             OriginalAttributes,
             NULL
             );
  }
}
In above codes, VS2012/VS2010 will report that "OriginalAttributes"
will be used without initialization. But in fact, when the if expression
is true(if (PciIo != NULL && Enabled)), the "OriginalAttributes" must be
initialized. In order to fix this false positive issue, we initialize the
"OriginalAttributes" after declaration.

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>
This commit is contained in:
Dandan Bi 2017-11-22 09:54:10 +08:00 committed by Hao Wu
parent 8284b1791e
commit 2d3a626e3e
1 changed files with 1 additions and 0 deletions

View File

@ -178,6 +178,7 @@ PcatIsaAcpiDriverBindingStart (
Enabled = FALSE;
Supports = 0;
PcatIsaAcpiDev = NULL;
OriginalAttributes = 0;
//
// Open the PCI I/O Protocol Interface
//