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>
This commit is contained in:
parent
641d446f89
commit
f8300ab8c3
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue