efi_loader: Fix UEFI error handling
PATCH v2 1/1 efi_loader: Fix UEFI error handling
Try to catch error the earlier way.
Signed-off-by Weizhao Ouyang <[email protected]>
---
Changes in v2:
- Avoid to stop the boot process.
lib/efi_loader/efi_var_file.c | 4 +++- lib/efi_loader/efi_variable.c | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-)
lib/efi_loader/efi_var_file.c +3 -1
@@ -192,8 +192,10 @@ efi_status_t efi_var_restore(struct efi_var_file *buf, bool safe) ret =efi_var_mem_ins (var->name, &var->guid, var->attr, var->length, data,0 ,NULL , var->time); -if (ret !=EFI_SUCCESS ) +if (ret !=EFI_SUCCESS ) {log_err ("Failed to set EFI variable %ls\n" , var->name); +return ret; + } }return EFI_SUCCESS ; }
lib/efi_loader/efi_variable.c +0 -2
@@ -350,8 +350,6 @@ efi_status_t efi_set_variable_int(const u16 *variable_name,if (var_type ==EFI_AUTH_VAR_PK ) ret =efi_init_secure_state (); -else - ret =EFI_SUCCESS ;/* * Write non-volatile EFI variables to file
Signature · 1 line
2.39.2