提交 f8300ab8 编写于 作者: J Julia Lawall 提交者: 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: NJulia Lawall <julia@diku.dk>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 641d446f
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册