From: Dandan Bi <dandan.bi@intel.com>
To: edk2-devel@lists.01.org
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Subject: [patch] PcAtChipsetPkg/IsaAcpiDxe: Fix VS2012 build failure
Date: Wed, 22 Nov 2017 10:02:20 +0800 [thread overview]
Message-ID: <1511316140-12868-1-git-send-email-dandan.bi@intel.com> (raw)
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>
---
PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c b/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
index d82e2c4..c7ea559 100644
--- a/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
+++ b/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
@@ -176,10 +176,11 @@ PcatIsaAcpiDriverBindingStart (
BOOLEAN Enabled;
Enabled = FALSE;
Supports = 0;
PcatIsaAcpiDev = NULL;
+ OriginalAttributes = 0;
//
// Open the PCI I/O Protocol Interface
//
PciIo = NULL;
Status = gBS->OpenProtocol (
--
1.9.5.msysgit.1
next reply other threads:[~2017-11-22 1:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-22 2:02 Dandan Bi [this message]
2017-11-22 2:40 ` [patch] PcAtChipsetPkg/IsaAcpiDxe: Fix VS2012 build failure Ni, Ruiyu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1511316140-12868-1-git-send-email-dandan.bi@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox