Skip to content

Commit cdcc09a

Browse files
raagjadavandy-shev
authored andcommitted
input: sparse-keymap: use devm_kmemdup_array()
Convert to use devm_kmemdup_array() and while at it, use source size instead of destination. Signed-off-by: Raag Jadav <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent a0d78ee commit cdcc09a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/input/sparse-keymap.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ int sparse_keymap_setup(struct input_dev *dev,
176176
for (e = keymap; e->type != KE_END; e++)
177177
map_size++;
178178

179-
map = devm_kmemdup(&dev->dev, keymap, map_size * sizeof(*map),
180-
GFP_KERNEL);
179+
map = devm_kmemdup_array(&dev->dev, keymap, map_size, sizeof(*keymap), GFP_KERNEL);
181180
if (!map)
182181
return -ENOMEM;
183182

0 commit comments

Comments
 (0)