]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: v4l2-subdev: Fail {enable,disable}_streams and s_streaming nicely
authorSakari Ailus <sakari.ailus@linux.intel.com>
Sat, 21 Mar 2026 21:41:50 +0000 (23:41 +0200)
committerSakari Ailus <sakari.ailus@linux.intel.com>
Tue, 5 May 2026 07:21:22 +0000 (10:21 +0300)
commit0bcbfd1c1142d85faef8df5cb679d37f71394c5f
tree1824305599caa3c08ee4c9a848f447fd35ce22e5
parent5a6ec95b0b471105ac601a21db87a03f7f1af967
media: v4l2-subdev: Fail {enable,disable}_streams and s_streaming nicely

If a sub-device does not set enable_streams() and disable_streams() pad
ops while it sets the s_stream() video op to
v4l2_subdev_s_stream_helper(), enabling or disabling streaming either way
on the sub-device will result calling v4l2_subdev_s_stream_helper() and
v4l2_subdev_{enable,disable}_streams() recursively, exhausting the stack.
Return -ENOIOCTLCMD in this case to handle the situation gracefully.

Fixes: b62949ddaa52 ("media: subdev: Support single-stream case in v4l2_subdev_enable/disable_streams()")
Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
drivers/media/v4l2-core/v4l2-subdev.c