@@ -573,8 +573,8 @@ efi_status_t efi_set_variable_int(u16 *variable_name,
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS);
s += sprintf(s, "{");
- while (attributes) {
- u32 attr = 1 << (ffs(attributes) - 1);
+ for (u32 attr_rem = attributes; attr_rem;) {
+ u32 attr = 1 << (ffs(attr_rem) - 1);
if (attr == EFI_VARIABLE_NON_VOLATILE)
s += sprintf(s, "nv");
@@ -583,8 +583,8 @@ efi_status_t efi_set_variable_int(u16 *variable_name,
else if (attr == EFI_VARIABLE_RUNTIME_ACCESS)
s += sprintf(s, "run");
- attributes &= ~attr;
- if (attributes)
+ attr_rem &= ~attr;
+ if (attr_rem)
s += sprintf(s, ",");
}
s += sprintf(s, "}");
Do not change the value of parameter attributes in function efi_set_variable_int(). This allows to use it later. Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de> --- lib/efi_loader/efi_variable.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.25.1