Commit 1fa7e695 authored by Matt Fleming's avatar Matt Fleming
Browse files

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 <>
Acked-by: default avatarJeremy Kerr <>
Cc: Lee, Chun-Yi <>
Cc: Andy Whitcroft <>
Reported-by: default avatarLingzhu Xiang <>
Signed-off-by: default avatarMatt Fleming <>
parent b8f2c21d
......@@ -674,7 +674,7 @@ static int efi_status_to_err(efi_status_t status)
err = -EACCES;
err = -ENOENT;
err = -EIO;
err = -EINVAL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment