From: Hans Verkuil Date: Thu, 6 Jun 2019 10:00:30 +0000 (-0400) Subject: media: vicodec: stateless codecs do not have EOS and SOURCE_CHANGE events X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=3b6813d6f52d18674e5bbfcf7ff4bcec15569144;p=openwrt%2Fstaging%2Fblogic.git 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 --- diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c index ce7f7bf1b998..91cd0c1dbede 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);