mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-23 13:56:20 +00:00
efi: Fix ESRT refresh after Capsule update
Indicated by Coverity Scan CID 331147 The ESRT was being refreshed in situations where the UpdateCapsule procedure failed. In that scenario: 1) the ESRT refresh was superfluous. 2) a failed ESRT refresh return code overwrites the UpdateCapsule error return code. This commit ensures that the ESRT is only refreshed when the UpdateCapsule performs successfully. CC: Heinrich Schuchardt <xypron.glpk@gmx.de> CC: Sughosh Ganu <sughosh.ganu@linaro.org> CC: AKASHI Takahiro <takahiro.akashi@linaro.org> CC: Tom Rini <trini@konsulko.com> CC: Andre Przywara <andre.przywara@arm.com> CC: nd@arm.com Signed-off-by: Jose Marinho <jose.marinho@arm.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
6fe8b4a39d
commit
3627cf4bff
1 changed files with 1 additions and 1 deletions
|
@ -481,7 +481,6 @@ efi_status_t EFIAPI efi_update_capsule(
|
||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
out:
|
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_EFI_ESRT)) {
|
if (IS_ENABLED(CONFIG_EFI_ESRT)) {
|
||||||
/* Rebuild the ESRT to reflect any updated FW images. */
|
/* Rebuild the ESRT to reflect any updated FW images. */
|
||||||
|
@ -489,6 +488,7 @@ out:
|
||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS)
|
||||||
log_warning("EFI Capsule: failed to update ESRT\n");
|
log_warning("EFI Capsule: failed to update ESRT\n");
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
|
|
||||||
return EFI_EXIT(ret);
|
return EFI_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue