aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/misc/wistron_btns.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-05-19 10:11:14 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-05-19 10:14:38 -0700
commitf8300ab8c3e0bea42c82bbdcdff7b791b795d58f (patch)
tree259f14af19298ab2f6dcd5ff7dd3b645259fe975 /drivers/input/misc/wistron_btns.c
parent641d446f89314d19fe17fcb9f19659a09fabe418 (diff)
downloadlinux-linaro-android-f8300ab8c3e0bea42c82bbdcdff7b791b795d58f.tar.gz
Input: wistron_btns - switch to using kmemdup()
Use kmemdup when some other buffer is immediately copied into the allocated region. Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/misc/wistron_btns.c')
-rw-r--r--drivers/input/misc/wistron_btns.c4
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)
for (key = keymap; key->type != KE_END; key++)
length++;
- new_keymap = kmalloc(length * sizeof(struct key_entry), GFP_KERNEL);
+ new_keymap = kmemdup(keymap, length * sizeof(struct key_entry),
+ GFP_KERNEL);
if (!new_keymap)
return -ENOMEM;
- memcpy(new_keymap, keymap, length * sizeof(struct key_entry));
keymap = new_keymap;
return 0;