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

[media] v4l2-mem2mem: fix context removal from job queue in v4l2_m2m_streamoff

Just clearing the m2m_ctx->queue list_head will leave the m2m_dev->job_queue
in a broken state and can cause scheduling of device_runs after streamoff was
called.

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
d7bb0ce8 ede79413

+2 -1
+2 -1
drivers/media/v4l2-core/v4l2-mem2mem.c
··· 480 480 m2m_dev = m2m_ctx->m2m_dev; 481 481 spin_lock_irqsave(&m2m_dev->job_spinlock, flags_job); 482 482 /* We should not be scheduled anymore, since we're dropping a queue. */ 483 - INIT_LIST_HEAD(&m2m_ctx->queue); 483 + if (m2m_ctx->job_flags & TRANS_QUEUED) 484 + list_del(&m2m_ctx->queue); 484 485 m2m_ctx->job_flags = 0; 485 486 486 487 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);