提交 3e748268 编写于 作者: P Philipp Zabel 提交者: Mauro Carvalho Chehab

[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: NPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: NKamil Debski <k.debski@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 fcb62825
...@@ -812,6 +812,12 @@ static int coda_job_ready(void *m2m_priv) ...@@ -812,6 +812,12 @@ static int coda_job_ready(void *m2m_priv)
return 0; 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, v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev,
"job ready\n"); "job ready\n");
return 1; return 1;
...@@ -820,14 +826,11 @@ static int coda_job_ready(void *m2m_priv) ...@@ -820,14 +826,11 @@ static int coda_job_ready(void *m2m_priv)
static void coda_job_abort(void *priv) static void coda_job_abort(void *priv)
{ {
struct coda_ctx *ctx = priv; struct coda_ctx *ctx = priv;
struct coda_dev *dev = ctx->dev;
ctx->aborting = 1; ctx->aborting = 1;
v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev,
"Aborting task\n"); "Aborting task\n");
v4l2_m2m_job_finish(dev->m2m_dev, ctx->m2m_ctx);
} }
static void coda_lock(void *m2m_priv) static void coda_lock(void *m2m_priv)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册