core/v4l2-mem2mem.c
@@ -438,9 +438,14 @@ int v4l2_m2m_streamoff(struct file *file, struct
v4l2_m2m_ctx *m2m_ctx,
m2m_dev = m2m_ctx->m2m_dev;
spin_lock_irqsave(&m2m_dev->job_spinlock, flags_job);
/* We should not be scheduled anymore, since we're dropping a queue. */
- if (!list_empty(&m2m_dev->job_queue))
- list_del(&m2m_ctx->queue);
-
+ if (!list_empty(&m2m_dev->job_queue)) {
+ struct v4l2_m2m_ctx *list_ctx, *temp_ctx;
+ list_for_each_entry_safe(list_ctx, temp_ctx,
+ &m2m_dev->job_queue, queue) {
+ if (list_ctx == m2m_ctx)
+ list_del(&m2m_ctx->queue);
+ }
+ }
INIT_LIST_HEAD(&m2m_ctx->queue);
m2m_ctx->job_flags = 0;
In multi-instance scenario with multi-core, m2m_ctx->queue is removed again sometimes. So, it is need to check whether the queue is removed or not. Change-Id: Ie938e9026039304388a369d5d10d1654213ba3b1 Signed-off-by: Sungchun Kang <sungchun.kang@samsung.com> --- drivers/media/v4l2-core/v4l2-mem2mem.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)