diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2010-01-09 17:51:14 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 19:10:35 +0100 |
commit | 8231152f74dd9bd6f76036cfd7fbbf94ad0073d8 (patch) | |
tree | 3338ec930be2c52d05c2824895bce6c431af000a /drivers/media/IR | |
parent | V4L/DVB (13965): zl10039, jump to error on error (diff) | |
download | linux-8231152f74dd9bd6f76036cfd7fbbf94ad0073d8.tar.xz linux-8231152f74dd9bd6f76036cfd7fbbf94ad0073d8.zip |
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>
Diffstat (limited to 'drivers/media/IR')
-rw-r--r-- | drivers/media/IR/ir-keytable.c | 4 |
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, ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size); ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size * sizeof(struct ir_scancode), GFP_KERNEL); - if (!ir_dev->rc_tab.scan) + if (!ir_dev->rc_tab.scan) { + kfree(ir_dev); return -ENOMEM; + } IR_dprintk(1, "Allocated space for %d keycode entries (%zd bytes)\n", ir_dev->rc_tab.size, |