Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] v4l2-mem2mem: clear m2m queue ready counter in v4l2_m2m_streamoff

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>

authored by

Philipp Zabel and committed by
Mauro Carvalho Chehab
84e68098 d7bb0ce8

+1
+1
drivers/media/v4l2-core/v4l2-mem2mem.c
··· 488 488 /* Drop queue, since streamoff returns device to the same state as after 489 489 * calling reqbufs. */ 490 490 INIT_LIST_HEAD(&q_ctx->rdy_queue); 491 + q_ctx->num_rdy = 0; 491 492 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); 492 493 493 494 if (m2m_dev->curr_ctx == m2m_ctx) {