diff options
Diffstat (limited to 'drivers/input/misc/wistron_btns.c')
-rw-r--r-- | drivers/input/misc/wistron_btns.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c index 04d5a4a3181..4dac8b79fcd 100644 --- a/drivers/input/misc/wistron_btns.c +++ b/drivers/input/misc/wistron_btns.c | |||
@@ -983,11 +983,11 @@ static int __init copy_keymap(void) | |||
983 | for (key = keymap; key->type != KE_END; key++) | 983 | for (key = keymap; key->type != KE_END; key++) |
984 | length++; | 984 | length++; |
985 | 985 | ||
986 | new_keymap = kmalloc(length * sizeof(struct key_entry), GFP_KERNEL); | 986 | new_keymap = kmemdup(keymap, length * sizeof(struct key_entry), |
987 | GFP_KERNEL); | ||
987 | if (!new_keymap) | 988 | if (!new_keymap) |
988 | return -ENOMEM; | 989 | return -ENOMEM; |
989 | 990 | ||
990 | memcpy(new_keymap, keymap, length * sizeof(struct key_entry)); | ||
991 | keymap = new_keymap; | 991 | keymap = new_keymap; |
992 | 992 | ||
993 | return 0; | 993 | return 0; |