提交 16ee9bb1 编写于 作者: D Dan Carpenter 提交者: Mauro Carvalho Chehab

V4L/DVB: media/mem2mem: dereferencing free memory

We dereferenced "ctx" on the error path.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 a7b39036
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册