Commit f8300ab8 authored by Julia Lawall's avatar Julia Lawall Committed by Dmitry Torokhov

Input: wistron_btns - switch to using kmemdup()

Use kmemdup when some other buffer is immediately copied into the
allocated region.
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 641d446f
...@@ -983,11 +983,11 @@ static int __init copy_keymap(void) ...@@ -983,11 +983,11 @@ static int __init copy_keymap(void)
for (key = keymap; key->type != KE_END; key++) for (key = keymap; key->type != KE_END; key++)
length++; 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) if (!new_keymap)
return -ENOMEM; return -ENOMEM;
memcpy(new_keymap, keymap, length * sizeof(struct key_entry));
keymap = new_keymap; keymap = new_keymap;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment