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 <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Eric Jin <[email protected]>
---
 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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#44763): https://edk2.groups.io/g/devel/message/44763
Mute This Topic: https://groups.io/mt/32676857/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to