Commit 8231152f authored by Alexander Beregalov's avatar Alexander Beregalov Committed by Mauro Carvalho Chehab

V4L/DVB: ir: fix memory leak

Free ir_dev before exit.
Found by cppcheck.
Signed-off-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 78b06e02
...@@ -421,8 +421,10 @@ int ir_input_register(struct input_dev *input_dev, ...@@ -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.size = ir_roundup_tablesize(rc_tab->size);
ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size * ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size *
sizeof(struct ir_scancode), GFP_KERNEL); sizeof(struct ir_scancode), GFP_KERNEL);
if (!ir_dev->rc_tab.scan) if (!ir_dev->rc_tab.scan) {
kfree(ir_dev);
return -ENOMEM; return -ENOMEM;
}
IR_dprintk(1, "Allocated space for %d keycode entries (%zd bytes)\n", IR_dprintk(1, "Allocated space for %d keycode entries (%zd bytes)\n",
ir_dev->rc_tab.size, ir_dev->rc_tab.size,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment