Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Sakari Ailus and committed by
Hans Verkuil
38c84932 72364b91

+6 -3
+6 -3
drivers/media/v4l2-core/v4l2-ioctl.c
··· 3461 3461 * FIXME: subdev IOCTLS are partially handled here and partially in 3462 3462 * v4l2-subdev.c and the 'always_copy' flag can only be set for IOCTLS 3463 3463 * defined here as part of the 'v4l2_ioctls' array. As 3464 - * VIDIOC_SUBDEV_G_ROUTING needs to return results to applications even 3465 - * in case of failure, but it is not defined here as part of the 3464 + * VIDIOC_SUBDEV_[GS]_ROUTING needs to return results to applications 3465 + * even in case of failure, but it is not defined here as part of the 3466 3466 * 'v4l2_ioctls' array, insert an ad-hoc check to address that. 3467 3467 */ 3468 - if (err < 0 && !always_copy && cmd != VIDIOC_SUBDEV_G_ROUTING) 3468 + if (cmd == VIDIOC_SUBDEV_G_ROUTING || cmd == VIDIOC_SUBDEV_S_ROUTING) 3469 + always_copy = true; 3470 + 3471 + if (err < 0 && !always_copy) 3469 3472 goto out; 3470 3473 3471 3474 if (has_array_args) {