Commit 38c84932 authored by Sakari Ailus's avatar Sakari Ailus Committed by Hans Verkuil
Browse files

media: v4l: subdev: Copy argument back to user also for S_ROUTING



As the user needs to know what went wrong for S_ROUTING, copy array
arguments back to the user.

Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: default avatarJulien Massot <julien.massot@collabora.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 72364b91
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -3461,11 +3461,14 @@ video_usercopy(struct file *file, unsigned int orig_cmd, unsigned long arg,
	 * FIXME: subdev IOCTLS are partially handled here and partially in
	 * v4l2-subdev.c and the 'always_copy' flag can only be set for IOCTLS
	 * defined here as part of the 'v4l2_ioctls' array. As
	 * VIDIOC_SUBDEV_G_ROUTING needs to return results to applications even
	 * in case of failure, but it is not defined here as part of the
	 * VIDIOC_SUBDEV_[GS]_ROUTING needs to return results to applications
	 * even in case of failure, but it is not defined here as part of the
	 * 'v4l2_ioctls' array, insert an ad-hoc check to address that.
	 */
	if (err < 0 && !always_copy && cmd != VIDIOC_SUBDEV_G_ROUTING)
	if (cmd == VIDIOC_SUBDEV_G_ROUTING || cmd == VIDIOC_SUBDEV_S_ROUTING)
		always_copy = true;

	if (err < 0 && !always_copy)
		goto out;

	if (has_array_args) {