Skip to content

Commit

Permalink
Staging: panel: fix memory leak
Browse files Browse the repository at this point in the history
panel_bind_key() must free allocated memory.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kulikov Vasiliy authored and Greg Kroah-Hartman committed Jul 22, 2010
1 parent d85170e commit cb46f47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/staging/panel/panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cb46f47

Please sign in to comment.