[media] v4l2-event: Deny subscribing with a type of V4L2_EVENT_ALL
authorHans de Goede <hdegoede@redhat.com>
Mon, 24 Oct 2011 08:03:27 +0000 (05:03 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 8 Nov 2011 12:29:05 +0000 (10:29 -0200)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/v4l2-event.c

index 53b190c..9f56f18 100644 (file)
@@ -215,6 +215,9 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
        unsigned long flags;
        unsigned i;
 
+       if (sub->type == V4L2_EVENT_ALL)
+               return -EINVAL;
+
        if (elems < 1)
                elems = 1;
        if (sub->type == V4L2_EVENT_CTRL) {