From: "Mike Maslenkin" <mike.maslenkin@gmail.com>
To: devel@edk2.groups.io
Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com
Subject: [edk2-devel] [PATCH 2/3] RedfishPkg: add explicit variable initialization
Date: Thu, 23 Nov 2023 02:50:07 +0300 [thread overview]
Message-ID: <20231122235008.31001-3-mike.maslenkin@gmail.com> (raw)
In-Reply-To: <20231122235008.31001-1-mike.maslenkin@gmail.com>
Ancient GCC 4.8.5 warned about variable may be unitialied.
And it doesn't look like false alarm.
The warning is:
edk2/RedfishPkg/Library/HiiUtilityLib/HiiUtilityInternal.c: In function 'GetQuestionDefault':
edk2/RedfishPkg/Library/HiiUtilityLib/HiiUtilityInternal.c:5519:6: error: 'ConfigAccess' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (ConfigAccess != NULL) {
Cc: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
RedfishPkg/Library/HiiUtilityLib/HiiUtilityInternal.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/RedfishPkg/Library/HiiUtilityLib/HiiUtilityInternal.c b/RedfishPkg/Library/HiiUtilityLib/HiiUtilityInternal.c
index 80b93beae999..b61b7f5fcdcc 100644
--- a/RedfishPkg/Library/HiiUtilityLib/HiiUtilityInternal.c
+++ b/RedfishPkg/Library/HiiUtilityLib/HiiUtilityInternal.c
@@ -5451,6 +5451,7 @@ GetQuestionDefault (
Status = EFI_NOT_FOUND;
StrValue = NULL;
+ ConfigAccess = NULL;
OriginalDefaultId = DefaultId;
DefaultLink = GetFirstNode (&FormSet->DefaultStoreListHead);
--
2.32.0 (Apple Git-132)
next prev parent reply other threads:[~2023-11-22 23:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 23:50 [edk2-devel] [PATCH 0/3] RedfishPkg: refine HiiUtilityLib and fix USB NIC discovering Mike Maslenkin
2023-11-22 23:50 ` [edk2-devel] [PATCH 1/3] RedfishPkg: fix memory leak in HiiUtilityLib Mike Maslenkin
2023-11-22 23:50 ` Mike Maslenkin [this message]
2023-11-22 23:50 ` [edk2-devel] [PATCH 3/3] RedfishPkg: fix searching for the BMC-exposed USB NIC Mike Maslenkin
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=20231122235008.31001-3-mike.maslenkin@gmail.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