diff options
| author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2026-02-05 11:19:35 +0300 |
|---|---|---|
| committer | Sakari Ailus <sakari.ailus@linux.intel.com> | 2026-05-07 13:23:50 +0300 |
| commit | bc1ba628e37c93cf2abeb2c79716f49087f8a024 (patch) | |
| tree | 77ba9c93a4f5edb7393f3415570f571332bbbe97 | |
| parent | 1155f8e0ccb36570caa2aabe5f00e617deed3a59 (diff) | |
| download | linux-bc1ba628e37c93cf2abeb2c79716f49087f8a024.tar.xz | |
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>
| -rw-r--r-- | drivers/media/v4l2-core/v4l2-subdev.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index 2e927ec336e5..e9f81b9be9e2 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -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; |
