[PATCH] V4L2: fix subdevice matching in asynchronous probing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
---

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

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux