public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] V4L2: fix subdevice matching in asynchronous probing
@ 2013-04-19 14:41 Guennadi Liakhovetski
  2013-04-22 10:34 ` Laurent Pinchart
  0 siblings, 1 reply; 3+ messages in thread
From: Guennadi Liakhovetski @ 2013-04-19 14:41 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: Prabhakar Lad

A wrapped list iterating loop hasn't been correctly recognised in
v4l2_async_belongs(), which led to false positives. Fix the bug by
verifying the loop termination condition.

Reported-by: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---

Prabhakar, please, check, whether this fixes your problem.

 drivers/media/v4l2-core/v4l2-async.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index 5d6b428..5631944 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -76,6 +76,10 @@ static struct v4l2_async_subdev *v4l2_async_belongs(struct v4l2_async_notifier *
 			break;
 	}
 
+	if (&asd->list == &notifier->waiting)
+		/* Wrapped - no match found */
+		return NULL;
+
 	return asd;
 }
 
-- 
1.7.2.5


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

end of thread, other threads:[~2013-04-22 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-19 14:41 [PATCH] V4L2: fix subdevice matching in asynchronous probing Guennadi Liakhovetski
2013-04-22 10:34 ` Laurent Pinchart
2013-04-22 10:43   ` Guennadi Liakhovetski

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