summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-12 18:48:24 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-22 11:34:52 -0700
commitcb46f472cbb08c44ae47a5bea80207c4e4407ee3 (patch)
tree4a5c03d33bdd43993df7eaefc60cca60efff1e00
parentd85170ed30a533ef6832cf11b38488e562c311c8 (diff)
downloadlinux-3.10-cb46f472cbb08c44ae47a5bea80207c4e4407ee3.tar.gz
linux-3.10-cb46f472cbb08c44ae47a5bea80207c4e4407ee3.tar.bz2
linux-3.10-cb46f472cbb08c44ae47a5bea80207c4e4407ee3.zip
Staging: panel: fix memory leak
panel_bind_key() must free allocated memory. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/panel/panel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 3e07e41eb88..aeca01c05e4 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -1995,8 +1995,10 @@ static struct logical_input *panel_bind_key(char *name, char *press,
return NULL;
}
if (!input_name2mask(name, &key->mask, &key->value, &scan_mask_i,
- &scan_mask_o))
+ &scan_mask_o)) {
+ kfree(key);
return NULL;
+ }
key->type = INPUT_TYPE_KBD;
key->state = INPUT_ST_LOW;