summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2013-09-19 07:40:32 (GMT)
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-10-28 17:20:38 (GMT)
commitd7bb0ce8884b3515abd8d4dc3e3500f9a9beeab6 (patch)
tree5f04e1d6b5e11f7ce52c2bb8d72064e9bcfae194 /drivers/media
parentede79413850a2b396ae5ed8629239ec6a8fdb792 (diff)
downloadlinux-d7bb0ce8884b3515abd8d4dc3e3500f9a9beeab6.tar.xz
[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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/v4l2-core/v4l2-mem2mem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
index 7c43712..8f116c2 100644
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
@@ -480,7 +480,8 @@ 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. */
- INIT_LIST_HEAD(&m2m_ctx->queue);
+ if (m2m_ctx->job_flags & TRANS_QUEUED)
+ list_del(&m2m_ctx->queue);
m2m_ctx->job_flags = 0;
spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);