summaryrefslogtreecommitdiff
path: root/include/linux/string.h
diff options
context:
space:
mode:
authorMichal Simek <[email protected]>2026-03-19 08:15:07 +0100
committerHeinrich Schuchardt <[email protected]>2026-04-17 07:40:17 +0200
commit57eae396ec91729d5655c26456f8ac3bac439202 (patch)
treef3d850421d9014a2b14141444d3b05b74bd2372b /include/linux/string.h
parent090a7eb9cf36aec08fbe131f0c475ccaa55a8241 (diff)
efi_loader: efi_var_sf: Do not fail on blank SPI Flash
When SPI Flash is blank (first boot or erased), efi_var_from_storage() returns EFI_DEVICE_ERROR because efi_var_restore() fails on invalid magic/CRC. This prevents the EFI subsystem from initializing. Check the magic value before attempting to restore variables. If the magic does not match EFI_VAR_FILE_MAGIC, treat it as an empty store and return EFI_SUCCESS, matching the behavior of the file-based efi_var_file.c which deliberately returns EFI_SUCCESS on missing or corrupted variable files to avoid blocking the boot process. Similarly, if the magic matches but efi_var_restore() fails (e.g. corrupted CRC), log the error but still return EFI_SUCCESS. Suggested-by: John Toomey <[email protected]> Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
Diffstat (limited to 'include/linux/string.h')
0 files changed, 0 insertions, 0 deletions