From: "Laszlo Ersek" <lersek@redhat.com>
To: mikuback@linux.microsoft.com, devel@edk2.groups.io
Cc: Jiewen Yao <jiewen.yao@intel.com>,
Jian J Wang <jian.j.wang@intel.com>,
Qi Zhang <qi1.zhang@intel.com>,
Rahul Kumar <rahul1.kumar@intel.com>, Kun Qin <kun.q@outlook.com>
Subject: Re: [PATCH v2 1/1] SecurityPkg/Tcg2Smm: Initialize local Status variable
Date: Wed, 7 Apr 2021 18:06:34 +0200 [thread overview]
Message-ID: <2e577197-2381-4849-f4db-4e2f992cae66@redhat.com> (raw)
In-Reply-To: <20210406181207.8731-1-mikuback@linux.microsoft.com>
On 04/06/21 20:12, mikuback@linux.microsoft.com wrote:
> From: Michael Kubacki <michael.kubacki@microsoft.com>
>
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3277
>
> Initializes the Status variable in TcgMmReadyToLock().
>
> Fixes a Clang build failure:
> Tcg2Smm.c - SecurityPkg\Tcg\Tcg2Smm\Tcg2Smm.c:254:7: error:
> variable 'Status' is used uninitialized whenever 'if'
> condition is false [-Werror,-Wsometimes-uninitialized]
>
> Initializing this variable is required to address a practical
> scenario in which the return value of TcgMmReadyToLock() is
> undefined based on conditional evaluation in the function.
>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Qi Zhang <qi1.zhang@intel.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Kun Qin <kun.q@outlook.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
> ---
>
> Notes:
> V2 change:
>
> Clarify in commit message that the issue reported by Clang is not
> solely a false positive.
>
> SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
> index 589c08794bcf..f49eccb0bdf4 100644
> --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
> +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
> @@ -253,6 +253,8 @@ TcgMmReadyToLock (
> {
> EFI_STATUS Status;
>
> + Status = EFI_SUCCESS;
> +
> if (mReadyToLockHandle != NULL) {
> Status = gMmst->MmiHandlerUnRegister (mReadyToLockHandle);
> mReadyToLockHandle = NULL;
>
Awesome, thanks!
I've also managed to look at the code now.
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Thanks
Laszlo
next prev parent reply other threads:[~2021-04-07 16:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 18:12 [PATCH v2 1/1] SecurityPkg/Tcg2Smm: Initialize local Status variable Michael Kubacki
2021-04-07 16:06 ` Laszlo Ersek [this message]
2021-04-12 17:54 ` [edk2-devel] " Michael Kubacki
2021-04-13 2:02 ` Wang, Jian J
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=2e577197-2381-4849-f4db-4e2f992cae66@redhat.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