提交 7df5af6f 编写于 作者: H Heinrich Schuchardt 提交者: Alexander Graf

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: NHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 5f1ce1d4
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册