[media] media: vb2: reset queued_count value during queue reinitialization
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 10 Jun 2011 11:58:42 +0000 (08:58 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 1 Jul 2011 01:32:58 +0000 (22:32 -0300)
queued_count variable was left untouched during the queue reinitialization
in __vb2_queue_cancel, what might lead to mismatch between the real number
of queued buffers and queued_count variable.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/videobuf2-core.c

index 6489aa26e78858842bde9ef60716c2483ec023d7..84f03b25aedb6901899eb61a90efd98afe3e1f46 100644 (file)
@@ -1189,6 +1189,7 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
         * has not already dequeued before initiating cancel.
         */
        INIT_LIST_HEAD(&q->done_list);
+       atomic_set(&q->queued_count, 0);
        wake_up_all(&q->done_wq);
 
        /*