diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-03-04 19:58:54 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-03-05 16:28:05 +0100 |
commit | b917445432d5fef789b1ea6c9a1d953f3034a12d (patch) | |
tree | a36a5995d7c6847902e7e3dcc77ca7bd36d8d8b6 | |
parent | 1961402668088cad92d56da8377dc7d8bb14e302 (diff) | |
download | barebox-b917445432d5.tar.gz barebox-b917445432d5.tar.xz |
efi: payload: image: return actual read_file() error
read_file returns NULL on error and sets errno, e.g. to ENOMEM if the
image to be booted exceeds memory available to barebox. Yet, errno was
ignored and EINVAL was returned as error code unconditionally. Fix this
to improve user experience.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240304190038.3486881-10-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | efi/payload/image.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/efi/payload/image.c b/efi/payload/image.c index 8e39098ae8..8d29bf9bb4 100644 --- a/efi/payload/image.c +++ b/efi/payload/image.c @@ -86,7 +86,7 @@ static int efi_load_image(const char *file, efi_loaded_image_t **loaded_image, exe = read_file(file, &size); if (!exe) - return -EINVAL; + return -errno; efiret = BS->load_image(false, efi_parent_image, efi_device_path, exe, size, &handle); |