summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vim2m.c
diff options
context:
space:
mode:
authorSantosh Kumar Singh <kumar.san1093@gmail.com>2016-12-19 14:12:46 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-01-31 07:44:26 -0200
commit7c13a4d6997ddb84b8c27bd90234c5ef1b020226 (patch)
tree21f37dc459ec45905316beb394c5dff8162522f1 /drivers/media/platform/vim2m.c
parentc4d27f4b4dc99715317696556d713f9094dca509 (diff)
downloadlinux-stable-7c13a4d6997ddb84b8c27bd90234c5ef1b020226.tar.gz
linux-stable-7c13a4d6997ddb84b8c27bd90234c5ef1b020226.tar.bz2
linux-stable-7c13a4d6997ddb84b8c27bd90234c5ef1b020226.zip
[media] vim2m: Clean up file handle in open() error path
Fix to avoid possible memory leak and exit file handle in error paths. Signed-off-by: Santosh Kumar Singh <kumar.san1093@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/vim2m.c')
-rw-r--r--drivers/media/platform/vim2m.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index a98f679bd88d..970b9b6dab25 100644
--- a/drivers/media/platform/vim2m.c
+++ b/drivers/media/platform/vim2m.c
@@ -907,6 +907,7 @@ static int vim2m_open(struct file *file)
if (hdl->error) {
rc = hdl->error;
v4l2_ctrl_handler_free(hdl);
+ kfree(ctx);
goto open_unlock;
}
ctx->fh.ctrl_handler = hdl;
@@ -928,6 +929,7 @@ static int vim2m_open(struct file *file)
rc = PTR_ERR(ctx->fh.m2m_ctx);
v4l2_ctrl_handler_free(hdl);
+ v4l2_fh_exit(&ctx->fh);
kfree(ctx);
goto open_unlock;
}