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>
This commit is contained in:
parent
fb56f4be05
commit
4d10452cd1
@ -1620,12 +1620,12 @@ static int vicodec_release(struct file *file)
|
|||||||
struct video_device *vfd = video_devdata(file);
|
struct video_device *vfd = video_devdata(file);
|
||||||
struct vicodec_ctx *ctx = file2ctx(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);
|
mutex_lock(vfd->lock);
|
||||||
v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
|
v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
|
||||||
mutex_unlock(vfd->lock);
|
mutex_unlock(vfd->lock);
|
||||||
|
v4l2_fh_del(&ctx->fh);
|
||||||
|
v4l2_fh_exit(&ctx->fh);
|
||||||
|
v4l2_ctrl_handler_free(&ctx->hdl);
|
||||||
kfree(ctx);
|
kfree(ctx);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user