mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-02 00:40:59 -05:00
efivarfs: Never return ENOENT from firmware
Files are created in efivarfs_create() before a corresponding variable is created in the firmware. This leads to users being able to read/write to the file without the variable existing in the firmware. Reading a non-existent variable currently returns -ENOENT, which is confusing because the file obviously *does* exist. Convert EFI_NOT_FOUND into -EIO which is the closest thing to "error while interacting with firmware", and should hopefully indicate to the caller that the variable is in some uninitialised state. Cc: Josh Boyer <[email protected]> Acked-by: Jeremy Kerr <[email protected]> Cc: Lee, Chun-Yi <[email protected]> Cc: Andy Whitcroft <[email protected]> Reported-by: Lingzhu Xiang <[email protected]> Signed-off-by: Matt Fleming <[email protected]>
This commit is contained in:
parent
b8f2c21db3
commit
1fa7e6958c
1 changed files with 1 additions and 1 deletions
|
|
@ -674,7 +674,7 @@ static int efi_status_to_err(efi_status_t status)
|
|||
err = -EACCES;
|
||||
break;
|
||||
case EFI_NOT_FOUND:
|
||||
err = -ENOENT;
|
||||
err = -EIO;
|
||||
break;
|
||||
default:
|
||||
err = -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue