diff options
author | Sughosh Ganu <sughosh.ganu@linaro.org> | 2024-09-09 16:50:21 +0530 |
---|---|---|
committer | Ilias Apalodimas <ilias.apalodimas@linaro.org> | 2024-09-19 10:52:50 +0300 |
commit | 6f933aa963bb971d848ff6bd1c743035bbc98ead (patch) | |
tree | 1341eb7088453b245a54951c6d1bab47a8014e90 | |
parent | be281eccb053c6d44bc8298024d5b7d637631c24 (diff) |
fwu: print a message if empty capsule checks fail
When dealing with processing of the empty capsule, the capsule gets
applied only when the checks for the empty capsule pass. Print a
message to highlight if empty capsule checks fail, and return an error
value, similar to the normal capsules.
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r-- | lib/efi_loader/efi_capsule.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index a4ea2873038..f8a4a7c6ef4 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -564,9 +564,14 @@ static efi_status_t efi_capsule_update_firmware( bool fw_accept_os; if (IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) { - if (fwu_empty_capsule_checks_pass() && - fwu_empty_capsule(capsule_data)) - return fwu_empty_capsule_process(capsule_data); + if (fwu_empty_capsule(capsule_data)) { + if (fwu_empty_capsule_checks_pass()) { + return fwu_empty_capsule_process(capsule_data); + } else { + log_err("FWU empty capsule checks failed. Cannot start update\n"); + return EFI_INVALID_PARAMETER; + } + } if (!fwu_update_checks_pass()) { log_err("FWU checks failed. Cannot start update\n"); |