public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Eric Jin" <eric.jin@intel.com>
To: devel@edk2.groups.io
Cc: Sean Brogan <sean.brogan@microsoft.com>,
	Bret Barkelew <Bret.Barkelew@microsoft.com>,
	Liming Gao <liming.gao@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>
Subject: [PATCH 11/14] FmpDevicePkg/FmpDxe: Fix SetLowestSupportedVersionInVariable()
Date: Thu,  1 Aug 2019 16:47:06 +0800	[thread overview]
Message-ID: <20190801084706.6728-1-eric.jin@intel.com> (raw)

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

The change that merged 4 UEFI Variables per device into a single
UEFI variable per device introduced a change in the behavior of
SetLowestSupportedVersionInVariable().  The UEFI Variable should
be updated if the current value is less than the new value.

The BOOLEAN local variable Update in all 4 Setxxx() functions
is also not initialized before use.  Initialize Update to
FALSE in all 4 functions.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Eric Jin <eric.jin@intel.com>
---
 FmpDevicePkg/FmpDxe/VariableSupport.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/FmpDevicePkg/FmpDxe/VariableSupport.c b/FmpDevicePkg/FmpDxe/VariableSupport.c
index 2508d3bbe6..414a077ab2 100644
--- a/FmpDevicePkg/FmpDxe/VariableSupport.c
+++ b/FmpDevicePkg/FmpDxe/VariableSupport.c
@@ -491,6 +491,7 @@ SetVersionInVariable (
     return;
   }
 
+  Update = FALSE;
   if (!FmpControllerState->VersionValid) {
     Update = TRUE;
   }
@@ -553,10 +554,11 @@ SetLowestSupportedVersionInVariable (
     return;
   }
 
+  Update = FALSE;
   if (!FmpControllerState->LsvValid) {
     Update = TRUE;
   }
-  if (FmpControllerState->Lsv != LowestSupportedVersion) {
+  if (FmpControllerState->Lsv < LowestSupportedVersion) {
     Update = TRUE;
   }
   FmpControllerState->LsvValid = TRUE;
@@ -615,6 +617,7 @@ SetLastAttemptStatusInVariable (
     return;
   }
 
+  Update = FALSE;
   if (!FmpControllerState->LastAttemptStatusValid) {
     Update = TRUE;
   }
@@ -677,6 +680,7 @@ SetLastAttemptVersionInVariable (
     return;
   }
 
+  Update = FALSE;
   if (!FmpControllerState->LastAttemptVersionValid) {
     Update = TRUE;
   }
-- 
2.20.1.windows.1


                 reply	other threads:[~2019-08-01  8:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190801084706.6728-1-eric.jin@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