aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-06-28 04:10:01 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-06-28 04:12:22 -0400
commit1fcb8bb631831c9018a1f7f77b93f9f02e122fc5 (patch)
tree2512a9600b0bffc8477476e125baceff1643625e /drivers/input/misc
parent671386bb23c57e5448f386a41101ed65ad1d488c (diff)
Input: wistron_btns - fix a memory leak in wb_module_init error path
select_keymap() calls copy_keymap() to allocate a memory for keymap. This patch adds a missing kfree(keymap) in wb_module_init error path. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/wistron_btns.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 4dac8b79fcd4..12501de0c5cd 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -1347,7 +1347,7 @@ static int __init wb_module_init(void)
1347 1347
1348 err = map_bios(); 1348 err = map_bios();
1349 if (err) 1349 if (err)
1350 return err; 1350 goto err_free_keymap;
1351 1351
1352 err = platform_driver_register(&wistron_driver); 1352 err = platform_driver_register(&wistron_driver);
1353 if (err) 1353 if (err)
@@ -1371,6 +1371,8 @@ static int __init wb_module_init(void)
1371 platform_driver_unregister(&wistron_driver); 1371 platform_driver_unregister(&wistron_driver);
1372 err_unmap_bios: 1372 err_unmap_bios:
1373 unmap_bios(); 1373 unmap_bios();
1374 err_free_keymap:
1375 kfree(keymap);
1374 1376
1375 return err; 1377 return err;
1376} 1378}