summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_variable.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-10-08 18:43:37 -0400
committerTom Rini <trini@konsulko.com>2019-10-08 18:43:37 -0400
commit8679be295682878177097557867929caa8e26b98 (patch)
tree3e4ac7c3ca2b9ddef6177a0bfdf4f81de7d194fd /lib/efi_loader/efi_variable.c
parentca88313dcd02b686851d7bc76fe941935fa014bc (diff)
parent3b728f8728fa7c596d30ecd27ebb64d37a54a12e (diff)
Merge tag 'efi-2020-01-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2020-01-rc1 The major corrections in this pull request are: Fixes for the SetVariable() boot service. Device path node for NVMe drives. Disable CONFIG_CMD_NVEDIT by default.
Diffstat (limited to 'lib/efi_loader/efi_variable.c')
-rw-r--r--lib/efi_loader/efi_variable.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
index 4c554c546b2..d0daf7bdebb 100644
--- a/lib/efi_loader/efi_variable.c
+++ b/lib/efi_loader/efi_variable.c
@@ -478,10 +478,12 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name,
old_size = 0;
}
} else {
- if ((data_size == 0 &&
- !(attributes & EFI_VARIABLE_APPEND_WRITE)) ||
- !attributes) {
- /* delete, but nothing to do */
+ if (data_size == 0 || !attributes ||
+ (attributes & EFI_VARIABLE_APPEND_WRITE)) {
+ /*
+ * Trying to delete or to update a non-existent
+ * variable.
+ */
ret = EFI_NOT_FOUND;
goto out;
}