On Thu Feb 5 10:19:35 2026 +0200, Sakari Ailus wrote:
> Disable access to routes when the STREAMS client capability bit isn't set.
> Routes aren't relevant otherwise anyway.
> 
> Signed-off-by: Sakari Ailus <[email protected]>
> Reviewed-by: Jacopo Mondi <[email protected]>
> Reviewed-by: Mirela Rabulea <[email protected]>
> Reviewed-by: Michael Riesch <[email protected]>
> Reviewed-by: Laurent Pinchart <[email protected]>

Patch committed.

Thanks,
Sakari Ailus

 drivers/media/v4l2-core/v4l2-subdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

---

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;
 
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to