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.cse...@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovet...@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

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

Reply via email to