From 3b6813d6f52d18674e5bbfcf7ff4bcec15569144 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 6 Jun 2019 06:00:30 -0400 Subject: [PATCH] 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/vicodec/vicodec-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c index ce7f7bf..91cd0c1 100644 --- a/drivers/media/platform/vicodec/vicodec-core.c +++ b/drivers/media/platform/vicodec/vicodec-core.c @@ -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); -- 2.7.4