Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16ee9bb1 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB: media/mem2mem: dereferencing free memory



We dereferenced "ctx" on the error path.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a7b39036
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);