This is a note to let you know that I've just added the patch titled media: vicodec: upon release, call m2m release before freeing ctrl handler to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: media-vicodec-upon-release-call-m2m-release-before-freeing-ctrl-handler.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 4d10452cd1ed619d95fde81cef837069f4c754cd Mon Sep 17 00:00:00 2001 From: Dafna Hirschfeld <dafna3@xxxxxxxxx> Date: Wed, 6 Mar 2019 16:13:25 -0500 Subject: media: vicodec: upon release, call m2m release before freeing ctrl handler From: Dafna Hirschfeld <dafna3@xxxxxxxxx> commit 4d10452cd1ed619d95fde81cef837069f4c754cd upstream. 'v4l2_m2m_ctx_release' calls request complete so it should be called before 'v4l2_ctrl_handler_free'. Signed-off-by: Dafna Hirschfeld <dafna3@xxxxxxxxx> Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@xxxxxxxxxx> Cc: Minh Yuan <yuanmingbuaa@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/media/platform/vicodec/vicodec-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/media/platform/vicodec/vicodec-core.c +++ b/drivers/media/platform/vicodec/vicodec-core.c @@ -1297,12 +1297,12 @@ static int vicodec_release(struct 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; Patches currently in stable-queue which might be from dafna3@xxxxxxxxx are queue-4.19/media-vicodec-upon-release-call-m2m-release-before-freeing-ctrl-handler.patch