public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] v4l2-event: v4l2_event_queue: do nothing if vdev == NULL
@ 2015-06-23  9:20 Hans Verkuil
  2015-06-25  9:12 ` Sakari Ailus
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Verkuil @ 2015-06-23  9:20 UTC (permalink / raw)
  To: linux-media, Sakari Ailus, Lars-Peter Clausen

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>

diff --git a/drivers/media/v4l2-core/v4l2-event.c b/drivers/media/v4l2-core/v4l2-event.c
index 8761aab..8d3171c 100644
--- a/drivers/media/v4l2-core/v4l2-event.c
+++ b/drivers/media/v4l2-core/v4l2-event.c
@@ -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);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-25  9:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-23  9:20 [PATCH] v4l2-event: v4l2_event_queue: do nothing if vdev == NULL Hans Verkuil
2015-06-25  9:12 ` Sakari Ailus
2015-06-25  9:22   ` Lars-Peter Clausen
2015-06-25  9:35     ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox