X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fefi_loader%2Fefi_boottime.c;h=da93498b36bbdec48b653e2046ca7e763479ff4c;hb=7df5af6f3acb7dc4a4b96d55d1f8c0cd83a527f6;hp=4a36b62828e82ffff8dba2331c92f022bc919910;hpb=5f1ce1d4ca4decef688fe0dd71b11927d6a18845;p=u-boot diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 4a36b62828..da93498b36 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