public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 11/14] FmpDevicePkg/FmpDxe: Fix SetLowestSupportedVersionInVariable()
@ 2019-08-01  8:47 Eric Jin
  0 siblings, 0 replies; only message in thread
From: Eric Jin @ 2019-08-01  8:47 UTC (permalink / raw)
  To: devel; +Cc: Sean Brogan, Bret Barkelew, Liming Gao, Michael D Kinney

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-01  8:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-01  8:47 [PATCH 11/14] FmpDevicePkg/FmpDxe: Fix SetLowestSupportedVersionInVariable() Eric Jin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox