diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2018-01-26 06:50:54 +0100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2018-01-28 21:37:13 +0100 |
commit | 7df5af6f3acb7dc4a4b96d55d1f8c0cd83a527f6 (patch) | |
tree | 2200377dab4595268b522271063b07108473d8ec | |
parent | 5f1ce1d4ca4decef688fe0dd71b11927d6a18845 (diff) | |
download | u-boot-7df5af6f3acb7dc4a4b96d55d1f8c0cd83a527f6.zip u-boot-7df5af6f3acb7dc4a4b96d55d1f8c0cd83a527f6.tar.gz u-boot-7df5af6f3acb7dc4a4b96d55d1f8c0cd83a527f6.tar.bz2 |
efi_loader: do not install NULL as device path
In an image is loaded from memory we do not have a device path.
Do not install NULL as device path in this case.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r-- | lib/efi_loader/efi_boottime.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 4a36b62..da93498 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1367,16 +1367,18 @@ efi_status_t efi_setup_loaded_image( obj->handle = info; info->file_path = file_path; - if (device_path) - info->device_handle = efi_dp_find_obj(device_path, NULL); - /* - * When asking for the device path interface, return - * bootefi_device_path - */ - ret = efi_add_protocol(obj->handle, &efi_guid_device_path, device_path); - if (ret != EFI_SUCCESS) - goto failure; + if (device_path) { + info->device_handle = efi_dp_find_obj(device_path, NULL); + /* + * When asking for the device path interface, return + * bootefi_device_path + */ + ret = efi_add_protocol(obj->handle, &efi_guid_device_path, + device_path); + if (ret != EFI_SUCCESS) + goto failure; + } /* * When asking for the loaded_image interface, just |