summaryrefslogtreecommitdiff
path: root/drivers/media/platform/vicodec
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna3@gmail.com>2019-03-06 16:13:25 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-03-25 13:28:27 -0400
commit4d10452cd1ed619d95fde81cef837069f4c754cd (patch)
treed1d11fd171833c8843b675ab07551fd75a186b2b /drivers/media/platform/vicodec
parentfb56f4be05adb64674a8a4ec230090960a61732e (diff)
media: vicodec: upon release, call m2m release before freeing ctrl handler
'v4l2_m2m_ctx_release' calls request complete so it should be called before 'v4l2_ctrl_handler_free'. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/vicodec')
-rw-r--r--drivers/media/platform/vicodec/vicodec-core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c
index c34a1ac15243..027daa51ced5 100644
--- a/drivers/media/platform/vicodec/vicodec-core.c
+++ b/drivers/media/platform/vicodec/vicodec-core.c
@@ -1620,12 +1620,12 @@ static int vicodec_release(struct file *file)
struct video_device *vfd = video_devdata(file);
struct vicodec_ctx *ctx = file2ctx(file);
- v4l2_fh_del(&ctx->fh);
- v4l2_fh_exit(&ctx->fh);
- v4l2_ctrl_handler_free(&ctx->hdl);
mutex_lock(vfd->lock);
v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
mutex_unlock(vfd->lock);
+ v4l2_fh_del(&ctx->fh);
+ v4l2_fh_exit(&ctx->fh);
+ v4l2_ctrl_handler_free(&ctx->hdl);
kfree(ctx);
return 0;