efi_loader: capsule: Record capsule result only if capsule is read
Record capsule update result only if the capsule file is successfully read, because the capsule GUID is not sure when the file can not be read or the file is not a capsule. Without this fix, if user puts a dummy (non-capsule) file under (ESP)EFI/UpdateCapsule, U-Boot causes a synchronous abort. This also fixes use-after-free bug of the 'capsule' variable. Fixes: c74cd8bd ("efi_loader: capsule: add capsule_on_disk support") Signed-off-by:Masami Hiramatsu <masami.hiramatsu@linaro.org> Reviewed-by:
Ilias Apalodimas <ilias.apalodimas@linaro.org>
Loading
Please register or sign in to comment