aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/coda.c
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2013-05-23 10:43:01 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-08 19:46:27 -0300
commit3e748268f391eaf46fe547eb3e51bfec387a63c5 (patch)
treefb41016a8dcd9821bee18041c6497fb56147a00b /drivers/media/platform/coda.c
parent[media] coda: replace completion with mutex (diff)
downloadlinux-dev-3e748268f391eaf46fe547eb3e51bfec387a63c5.tar.xz
linux-dev-3e748268f391eaf46fe547eb3e51bfec387a63c5.zip
[media] coda: do not call v4l2_m2m_job_finish from .job_abort
If we just declare the job finished here while the CODA is still running, the call to v4l2_m2m_ctx_release in coda_release, which is supposed to wait for a running job to finish, will return immediately and free memory that the CODA is still using. Just set the 'aborting' flag and let coda_irq_handler deal with it. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/coda.c')
-rw-r--r--drivers/media/platform/coda.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
index f9c4014ee40c..c4566c447774 100644
--- a/drivers/media/platform/coda.c
+++ b/drivers/media/platform/coda.c
@@ -812,6 +812,12 @@ static int coda_job_ready(void *m2m_priv)
return 0;
}
+ if (ctx->aborting) {
+ v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev,
+ "not ready: aborting\n");
+ return 0;
+ }
+
v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev,
"job ready\n");
return 1;
@@ -820,14 +826,11 @@ static int coda_job_ready(void *m2m_priv)
static void coda_job_abort(void *priv)
{
struct coda_ctx *ctx = priv;
- struct coda_dev *dev = ctx->dev;
ctx->aborting = 1;
v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev,
"Aborting task\n");
-
- v4l2_m2m_job_finish(dev->m2m_dev, ctx->m2m_ctx);
}
static void coda_lock(void *m2m_priv)