summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-05-05 02:58:57 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 12:59:13 -0300
commit16ee9bb100340f9f775ab334acb645f54642f312 (patch)
tree09dab848ac2864d5d76d714a67a01d85ed545a9b
parenta7b39036cfd1d3f868a6745e40bc99b2a8650bad (diff)
downloadop-kernel-dev-16ee9bb100340f9f775ab334acb645f54642f312.zip
op-kernel-dev-16ee9bb100340f9f775ab334acb645f54642f312.tar.gz
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>
-rw-r--r--drivers/media/video/mem2mem_testdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c
index baf211b..b161d26 100644
--- a/drivers/media/video/mem2mem_testdev.c
+++ b/drivers/media/video/mem2mem_testdev.c
@@ -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);
OpenPOWER on IntegriCloud