[media] v4l2-event: v4l2_event_queue: do nothing if vdev == NULL
authorHans Verkuil <hverkuil@xs4all.nl>
Tue, 23 Jun 2015 09:20:23 +0000 (06:20 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 17 Jul 2015 12:15:27 +0000 (09:15 -0300)
If the vdev pointer == NULL, then just return.

This makes it easier for subdev drivers to use this function without having to
check if the sd->devnode pointer is NULL or not.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/v4l2-core/v4l2-event.c

index 8761aab99de95b2f6e0efc80e2a4d9780b62e9b3..8d3171c6bee8e5be0d5f06d1e104151b4ee06485 100644 (file)
@@ -172,6 +172,9 @@ void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev)
        unsigned long flags;
        struct timespec timestamp;
 
+       if (vdev == NULL)
+               return;
+
        ktime_get_ts(&timestamp);
 
        spin_lock_irqsave(&vdev->fh_lock, flags);
This page took 0.027764 seconds and 5 git commands to generate.