aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Beregalov <a.beregalov@gmail.com>2010-01-09 11:51:14 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:35 -0500
commit8231152f74dd9bd6f76036cfd7fbbf94ad0073d8 (patch)
tree3338ec930be2c52d05c2824895bce6c431af000a
parent78b06e0201fb32716211959bce133740a13873c4 (diff)
V4L/DVB: ir: fix memory leak
Free ir_dev before exit. Found by cppcheck. Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/IR/ir-keytable.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index 161d70b57965..0903f539bf68 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -421,8 +421,10 @@ int ir_input_register(struct input_dev *input_dev,
421 ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size); 421 ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size);
422 ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size * 422 ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size *
423 sizeof(struct ir_scancode), GFP_KERNEL); 423 sizeof(struct ir_scancode), GFP_KERNEL);
424 if (!ir_dev->rc_tab.scan) 424 if (!ir_dev->rc_tab.scan) {
425 kfree(ir_dev);
425 return -ENOMEM; 426 return -ENOMEM;
427 }
426 428
427 IR_dprintk(1, "Allocated space for %d keycode entries (%zd bytes)\n", 429 IR_dprintk(1, "Allocated space for %d keycode entries (%zd bytes)\n",
428 ir_dev->rc_tab.size, 430 ir_dev->rc_tab.size,