media: vicodec: stateless codecs do not have EOS and SOURCE_CHANGE events

Return an error when attempting to subscribe to those events
for a stateless codec.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
Hans Verkuil 2019-06-06 06:00:30 -04:00 committed by Mauro Carvalho Chehab
parent 8307f0ab03
commit 3b6813d6f5
1 changed files with 2 additions and 0 deletions

View File

@ -1293,6 +1293,8 @@ static int vicodec_subscribe_event(struct v4l2_fh *fh,
return -EINVAL;
/* fall through */
case V4L2_EVENT_EOS:
if (ctx->is_stateless)
return -EINVAL;
return v4l2_event_subscribe(fh, sub, 0, NULL);
default:
return v4l2_ctrl_subscribe_event(fh, sub);