Skip to content
Commit 68e87ebf authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

media: v4l2-subdev.c: clear stream field



Both userspace and kernelspace can pass structs with an uninitialized
'stream' field. Since the check_state() function checks for a non-zero
stream field, suddenly these calls will fails with -EINVAL.

So check in the wrapper functions in v4l2-subdev.c (which are used by both
the kernel and userspace API) if V4L2_SUBDEV_FL_STREAMS is set, and if not,
then zero the stream field.

Currently no drivers set V4L2_SUBDEV_FL_STREAMS, so the stream field will
always be set to 0.

This patch might well be reverted in the future when streams support is
fully enabled and we finalized the userspace API support for this feature.

Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 83e0f265
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment