From: "Guomin Jiang" <guomin.jiang@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"michael.kubacki@outlook.com" <michael.kubacki@outlook.com>
Cc: "Gao, Liming" <liming.gao@intel.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>,
"Xu, Wei6" <wei6.xu@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] FmpDevicePkg/FmpDxe: Fix Clang build error
Date: Wed, 12 Aug 2020 07:04:46 +0000 [thread overview]
Message-ID: <DM6PR11MB2955E12E61693302FBCD6EC79D420@DM6PR11MB2955.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MWHPR07MB3440718C3234ADDB0F5816B5E9420@MWHPR07MB3440.namprd07.prod.outlook.com>
Reviewed-by: Guomin Jiang <guomin.jiang@intel.com>
Thanks
Guomin
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael
> Kubacki
> Sent: Wednesday, August 12, 2020 8:24 AM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>;
> Xu, Wei6 <wei6.xu@intel.com>
> Subject: [edk2-devel] [PATCH v1 1/1] FmpDevicePkg/FmpDxe: Fix Clang build
> error
>
> From: Michael Kubacki <michael.kubacki@microsoft.com>
>
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2887
>
> The local Private pointer variable in SetTheImage() is initialized based on the
> caller provided This pointer argument. The cleanup label path uses the
> Private pointer which will not be initialized if This is NULL.
>
> This change initializes Private to NULL and accounts for Private potentially
> being NULL in the cleanup label path.
>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Wei6 Xu <wei6.xu@intel.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> ---
> FmpDevicePkg/FmpDxe/FmpDxe.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c
> b/FmpDevicePkg/FmpDxe/FmpDxe.c index 854feec0a162..427b215ddc5f
> 100644
> --- a/FmpDevicePkg/FmpDxe/FmpDxe.c
> +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
> @@ -1043,6 +1043,7 @@ SetTheImage (
> UINT32 DependenciesSize;
>
> Status = EFI_SUCCESS;
> + Private = NULL;
> Updateable = 0;
> BooleanValue = FALSE;
> FmpHeaderSize = 0;
> @@ -1293,7 +1294,10 @@ SetTheImage (
>
> cleanup:
> mProgressFunc = NULL;
> - SetLastAttemptStatusInVariable (Private, LastAttemptStatus);
> +
> + if (Private != NULL) {
> + SetLastAttemptStatusInVariable (Private, LastAttemptStatus); }
>
> if (Progress != NULL) {
> //
> @@ -1306,7 +1310,9 @@ SetTheImage (
> // Need repopulate after SetImage is called to
> // update LastAttemptVersion and LastAttemptStatus.
> //
> - Private->DescriptorPopulated = FALSE;
> + if (Private != NULL) {
> + Private->DescriptorPopulated = FALSE; }
>
> return Status;
> }
> --
> 2.28.0.windows.1
>
>
>
prev parent reply other threads:[~2020-08-12 7:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-12 0:23 [PATCH v1 1/1] FmpDevicePkg/FmpDxe: Fix Clang build error Michael Kubacki
2020-08-12 1:07 ` [edk2-devel] " Liming Gao
2020-08-12 7:04 ` Guomin Jiang [this message]
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=DM6PR11MB2955E12E61693302FBCD6EC79D420@DM6PR11MB2955.namprd11.prod.outlook.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