mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
V4L/DVB: media/mem2mem: dereferencing free memory
We dereferenced "ctx" on the error path. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
a7b39036cf
commit
16ee9bb100
1 changed files with 3 additions and 1 deletions
|
@ -871,8 +871,10 @@ static int m2mtest_open(struct file *file)
|
|||
|
||||
ctx->m2m_ctx = v4l2_m2m_ctx_init(ctx, dev->m2m_dev, queue_init);
|
||||
if (IS_ERR(ctx->m2m_ctx)) {
|
||||
int ret = PTR_ERR(ctx->m2m_ctx);
|
||||
|
||||
kfree(ctx);
|
||||
return PTR_ERR(ctx->m2m_ctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
atomic_inc(&dev->num_inst);
|
||||
|
|
Loading…
Reference in a new issue