lkml.org 
[lkml]   [2016]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] vim2m: Clean up file handle in open() error path.
Date
Fix to avoid possible memory leak and exit file handle
in error paths.

Signed-off-by: Santosh Kumar Singh <kumar.san1093@gmail.com>
---
drivers/media/platform/vim2m.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index a98f679..9fd24b8 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;
@@ -929,6 +930,7 @@ static int vim2m_open(struct file *file)

v4l2_ctrl_handler_free(hdl);
kfree(ctx);
+ v4l2_fh_exit(&ctx->fh);
goto open_unlock;
}

--
1.9.1
\
 
 \ /
  Last update: 2016-12-07 18:24    [W:0.040 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site