Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;