aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_var_file.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-12-29 13:32:50 -0500
committerTom Rini <trini@konsulko.com>2022-12-29 13:32:50 -0500
commitd36bc89be2793a03da151f067d4889d9a32d3908 (patch)
tree7fde10a06c430caf0ae0db3a44fc3ef06506f313 /lib/efi_loader/efi_var_file.c
parent6f975524cbf7d39c925cb101be9ff09b5e70dbbe (diff)
parentf557cf08b974c359ad3c53a87297d19fe13ff4f0 (diff)
Merge tag 'efi-2023-01-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2023-01-rc5-2 Documentation: * Reorganize existing TI docs and add K3 generation page * Add texinfodocs and infodocs targets * Update qemu-ppce500 documentation * Use "changesets" not "csets" in statistics pages UEFI * Fix merging of preseeded non-volatile variables * Fix a return value in the EFI_HII_DATABASE_PROTOCOL * Set UEFI specification version to 2.10
Diffstat (limited to 'lib/efi_loader/efi_var_file.c')
-rw-r--r--lib/efi_loader/efi_var_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_var_file.c b/lib/efi_loader/efi_var_file.c
index 3d58caa13d..62e071bd83 100644
--- a/lib/efi_loader/efi_var_file.c
+++ b/lib/efi_loader/efi_var_file.c
@@ -176,7 +176,7 @@ efi_status_t efi_var_restore(struct efi_var_file *buf, bool safe)
data = var->name + u16_strlen(var->name) + 1;
/*
- * Secure boot related and non-volatile variables shall only be
+ * Secure boot related and volatile variables shall only be
* restored from U-Boot's preseed.
*/
if (!safe &&
@@ -187,6 +187,8 @@ efi_status_t efi_var_restore(struct efi_var_file *buf, bool safe)
continue;
if (!var->length)
continue;
+ if (efi_var_mem_find(&var->guid, var->name, NULL))
+ continue;
ret = efi_var_mem_ins(var->name, &var->guid, var->attr,
var->length, data, 0, NULL,
var->time);