mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 18:21:24 +02: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:
parent
1155f8e0cc
commit
bc1ba628e3
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user