From: Sakari Ailus Date: Thu, 5 Feb 2026 08:19:35 +0000 (+0200) Subject: media: v4l2-subdev: Allow accessing routes with STREAMS client capability X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=bc1ba628e37c93cf2abeb2c79716f49087f8a024;p=thirdparty%2Flinux.git 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 Reviewed-by: Jacopo Mondi Reviewed-by: Mirela Rabulea Reviewed-by: Michael Riesch Reviewed-by: Laurent Pinchart --- 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;