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.");
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);