mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 17:59:32 +00:00
[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>
This commit is contained in:
parent
c4d27f4b4d
commit
7c13a4d699
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue