From: ksa678491784 Date: Tue, 28 Dec 2021 15:09:33 +0000 (+0300) Subject: stub: Do not assume having DeviceHandle X-Git-Tag: v251-rc1~632 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5204355861643a658a6d8e009b67e422cdb9194b;p=thirdparty%2Fsystemd.git stub: Do not assume having DeviceHandle --- diff --git a/src/boot/efi/cpio.c b/src/boot/efi/cpio.c index be0708aec43..74610cc1c7f 100644 --- a/src/boot/efi/cpio.c +++ b/src/boot/efi/cpio.c @@ -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."); diff --git a/src/boot/efi/disk.c b/src/boot/efi/disk.c index 6d3c8285a15..b7beac3d08b 100644 --- a/src/boot/efi/disk.c +++ b/src/boot/efi/disk.c @@ -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);