[media] v4l2-mem2mem: clear m2m queue ready counter in v4l2_m2m_streamoff
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 19 Sep 2013 07:53:21 +0000 (04:53 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Mon, 28 Oct 2013 17:20:48 +0000 (15:20 -0200)
v4l2_m2m_streamoff drops the list of ready buffers but failed to reset the
num_rdy counter to zero. This would lead to v4l2_m2m_num_src/dst_bufs_ready
reporting wrong values after streamoff.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/v4l2-mem2mem.c

index 8f116c2642dbdc57234e4cf232e007357fd0fac8..796de33493032211cb5f754e7edaf9b27c46a80c 100644 (file)
@@ -488,6 +488,7 @@ int v4l2_m2m_streamoff(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
        /* Drop queue, since streamoff returns device to the same state as after
         * calling reqbufs. */
        INIT_LIST_HEAD(&q_ctx->rdy_queue);
+       q_ctx->num_rdy = 0;
        spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
 
        if (m2m_dev->curr_ctx == m2m_ctx) {