Skip to content

Commit

Permalink
Input: sparse-keymap - free the right keymap on error
Browse files Browse the repository at this point in the history
'map' is allocated in sparse_keymap_setup() and it it the one that should
be freed on error instead of 'keymap'.

Signed-off-by: Yong Wang <yong.y.wang@intel.com>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Yong Wang authored and Dmitry Torokhov committed Mar 20, 2010
1 parent 31968ec commit 88fcf71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/sparse-keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ int sparse_keymap_setup(struct input_dev *dev,
return 0;

err_out:
kfree(keymap);
kfree(map);
return error;

}
Expand Down

0 comments on commit 88fcf71

Please sign in to comment.