Skip to content

Commit

Permalink
V4L/DVB: media/mem2mem: dereferencing free memory
Browse files Browse the repository at this point in the history
We dereferenced "ctx" on the error path.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed May 19, 2010
1 parent a7b3903 commit 16ee9bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/video/mem2mem_testdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 16ee9bb

Please sign in to comment.