mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-01 15:35:25 -04:00
media: v4l2-subdev: Allow accessing routes with STREAMS client capability
Disable access to routes when the STREAMS client capability bit isn't set. Routes aren't relevant otherwise anyway. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> Reviewed-by: Michael Riesch <michael.riesch@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
This commit is contained in:
@@ -1019,6 +1019,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,
|
||||
if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS))
|
||||
return -ENOIOCTLCMD;
|
||||
|
||||
if (!client_supports_streams)
|
||||
return -EINVAL;
|
||||
|
||||
memset(routing->reserved, 0, sizeof(routing->reserved));
|
||||
|
||||
v4l2_subdev_copy_routes(routing, state);
|
||||
@@ -1040,6 +1043,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,
|
||||
if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS))
|
||||
return -ENOIOCTLCMD;
|
||||
|
||||
if (!client_supports_streams)
|
||||
return -EINVAL;
|
||||
|
||||
if (routing->which != V4L2_SUBDEV_FORMAT_TRY && ro_subdev)
|
||||
return -EPERM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user