1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 03:25:31 +03:00

stub: Do not assume having DeviceHandle

This commit is contained in:
ksa678491784 2021-12-28 18:09:33 +03:00 committed by Yu Watanabe
parent 80bfc3b901
commit 5204355861
2 changed files with 8 additions and 1 deletions

View File

@ -330,6 +330,12 @@ EFI_STATUS pack_cpio(
assert(ret_buffer);
assert(ret_buffer_size);
if (!loaded_image->DeviceHandle) {
*ret_buffer = NULL;
*ret_buffer_size = 0;
return EFI_SUCCESS;
}
root = LibOpenRoot(loaded_image->DeviceHandle);
if (!root)
return log_error_status_stall(EFI_LOAD_ERROR, L"Unable to open root directory.");

View File

@ -10,7 +10,8 @@ EFI_STATUS disk_get_part_uuid(EFI_HANDLE *handle, CHAR16 uuid[static 37]) {
EFI_DEVICE_PATH *device_path;
_cleanup_freepool_ EFI_DEVICE_PATH *paths = NULL;
assert(handle);
if (!handle)
return EFI_NOT_FOUND;
/* export the device path this image is started from */
device_path = DevicePathFromHandle(handle);