提交 1fcb8bb6 编写于 作者: A Axel Lin 提交者: Dmitry Torokhov

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: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 671386bb
...@@ -1347,7 +1347,7 @@ static int __init wb_module_init(void) ...@@ -1347,7 +1347,7 @@ static int __init wb_module_init(void)
err = map_bios(); err = map_bios();
if (err) if (err)
return err; goto err_free_keymap;
err = platform_driver_register(&wistron_driver); err = platform_driver_register(&wistron_driver);
if (err) if (err)
...@@ -1371,6 +1371,8 @@ static int __init wb_module_init(void) ...@@ -1371,6 +1371,8 @@ static int __init wb_module_init(void)
platform_driver_unregister(&wistron_driver); platform_driver_unregister(&wistron_driver);
err_unmap_bios: err_unmap_bios:
unmap_bios(); unmap_bios();
err_free_keymap:
kfree(keymap);
return err; return err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册