lkml.org 
[lkml]   [2010]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] wistron_btns: fix a memory leak in wb_module_init error path
From
Date
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>
---
drivers/input/misc/wistron_btns.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 4dac8b7..55ce70e 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -1371,6 +1371,7 @@ static int __init wb_module_init(void)
platform_driver_unregister(&wistron_driver);
err_unmap_bios:
unmap_bios();
+ kfree(keymap);

return err;
}
--
1.5.4.3




\
 
 \ /
  Last update: 2010-06-28 08:31    [W:0.265 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site