summaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/v4l2-mem2mem.c
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2014-05-26 15:49:22 +0200
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-04 21:11:44 +0200
commita85fd20fb62e5720ea4831b132334abc618972dd (patch)
tree9fc9eecc8c11a5617de048ee857a7d4942f9d5f1 /drivers/media/v4l2-core/v4l2-mem2mem.c
parent[media] staging: solo6x10: fix for sparse warning message (diff)
downloadlinux-a85fd20fb62e5720ea4831b132334abc618972dd.tar.xz
linux-a85fd20fb62e5720ea4831b132334abc618972dd.zip
[media] mem2mem: make queue lock in v4l2_m2m_poll interruptible
This patch makes the queue lock taken in v4l2_m2m_poll interruptible. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-mem2mem.c')
-rw-r--r--drivers/media/v4l2-core/v4l2-mem2mem.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
index 178ce96556c6..97defed7c1ac 100644
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
@@ -568,8 +568,12 @@ unsigned int v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
if (m2m_ctx->m2m_dev->m2m_ops->lock)
m2m_ctx->m2m_dev->m2m_ops->lock(m2m_ctx->priv);
- else if (m2m_ctx->q_lock)
- mutex_lock(m2m_ctx->q_lock);
+ else if (m2m_ctx->q_lock) {
+ if (mutex_lock_interruptible(m2m_ctx->q_lock)) {
+ rc |= POLLERR;
+ goto end;
+ }
+ }
spin_lock_irqsave(&src_q->done_lock, flags);
if (!list_empty(&src_q->done_list))