{
struct efi_loaded_image loaded_image_info = {};
struct efi_object loaded_image_info_obj = {};
+ struct efi_object mem_obj = {};
struct efi_device_path *memdp = NULL;
efi_status_t ret;
/* actual addresses filled in after efi_load_pe() */
memdp = efi_dp_from_mem(0, 0, 0);
device_path = image_path = memdp;
+ efi_add_handle(&mem_obj);
+
+ ret = efi_add_protocol(mem_obj.handle, &efi_guid_device_path,
+ device_path);
+ if (ret != EFI_SUCCESS)
+ goto exit;
} else {
assert(device_path && image_path);
}
exit:
/* image has returned, loaded-image obj goes *poof*: */
list_del(&loaded_image_info_obj.link);
+ if (mem_obj.handle)
+ list_del(&mem_obj.link);
return ret;
}