summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2017-10-08 06:57:26 +0200
committerAlexander Graf <agraf@suse.de>2017-10-09 07:00:37 +0200
commit1a2c8d2f609237664fcda944c251ce693e4366f5 (patch)
tree4e252a649026f1f5b987579902cc4f9fc8bd466f
parent7f8ec5b63e5a8774bfcadafbc0d9583686b00455 (diff)
downloadu-boot-1a2c8d2f609237664fcda944c251ce693e4366f5.tar.gz
u-boot-1a2c8d2f609237664fcda944c251ce693e4366f5.tar.xz
u-boot-1a2c8d2f609237664fcda944c251ce693e4366f5.zip
efi_loader: avoid NULL dereference in efi_dp_match
When calling bootefi hello twice a kernel dump occurs. Neither bootefi hello nor bootefi selftest have an image device patch. So do not try to dereference the NULL value. Fixes: 95c5553ea26 efi_loader: refactor boot device and loaded_image handling Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r--lib/efi_loader/efi_boottime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 976d5822f7..54cf16476c 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1154,7 +1154,8 @@ void efi_setup_loaded_image(struct efi_loaded_image *info, struct efi_object *ob
(void *)&efi_device_path_to_text;
info->file_path = file_path;
- info->device_handle = efi_dp_find_obj(device_path, NULL);
+ if (device_path)
+ info->device_handle = efi_dp_find_obj(device_path, NULL);
list_add_tail(&obj->link, &efi_obj_list);
}