Skip to content

Commit

Permalink
Input: wistron_btns - fix a memory leak in wb_module_init error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Dmitry Torokhov committed Jun 28, 2010
1 parent 671386b commit 1fcb8bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/input/misc/wistron_btns.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ static int __init wb_module_init(void)

err = map_bios();
if (err)
return err;
goto err_free_keymap;

err = platform_driver_register(&wistron_driver);
if (err)
Expand All @@ -1371,6 +1371,8 @@ static int __init wb_module_init(void)
platform_driver_unregister(&wistron_driver);
err_unmap_bios:
unmap_bios();
err_free_keymap:
kfree(keymap);

return err;
}
Expand Down

0 comments on commit 1fcb8bb

Please sign in to comment.