/* @image_obj: image handle @exit_data_size: size of the exit data buffer @exit_data: buffer with data returned by UEFI payload Return: status code  */
static efi_status_t efi_update_exit_data(struct efi_loaded_image_obj *image_obj, efi_uintn_t exit_data_size, u16 *exit_data)
/* @image_obj: image handle @exit_data_size: size of the exit data buffer @exit_data: buffer with data returned by UEFI payload Return: status code  */
static efi_status_t efi_update_exit_data(struct efi_loaded_image_obj *image_obj, efi_uintn_t exit_data_size, u16 *exit_data)
{
	efi_status_t ret;
	if (!image_obj->exit_data)
		return EFI_SUCCESS;
	if (image_obj->exit_data_size)
		*image_obj->exit_data_size = exit_data_size;
	if (exit_data_size && exit_data) {
		ret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA,
					exit_data_size,
					(void **)image_obj->exit_data);
		if (ret != EFI_SUCCESS)
			return ret;
		memcpy(*image_obj->exit_data, exit_data, exit_data_size);
	} else {
		image_obj->exit_data = NULL;
	}
	return EFI_SUCCESS;
}