]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
media: vicodec: move v4l2_ctrl_request_complete after spin_unlock
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Sat, 30 Mar 2019 14:27:36 +0000 (10:27 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 11 Jun 2019 15:28:01 +0000 (11:28 -0400)
v4l2_ctrl_request_complete can sleep, so can't be called while
a spinlock is held.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/vicodec/vicodec-core.c

index 72c56756e45b4916f194176414c8200645234396..358469f2319118d081084aacade0023fee894106 100644 (file)
@@ -442,14 +442,14 @@ static void device_run(void *priv)
                ctx->comp_has_next_frame = false;
        }
        v4l2_m2m_buf_done(dst_buf, state);
-       if (ctx->is_stateless && src_req)
-               v4l2_ctrl_request_complete(src_req, &ctx->hdl);
 
        ctx->comp_size = 0;
        ctx->header_size = 0;
        ctx->comp_magic_cnt = 0;
        ctx->comp_has_frame = false;
        spin_unlock(ctx->lock);
+       if (ctx->is_stateless && src_req)
+               v4l2_ctrl_request_complete(src_req, &ctx->hdl);
 
        if (ctx->is_enc)
                v4l2_m2m_job_finish(dev->stateful_enc.m2m_dev, ctx->fh.m2m_ctx);