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 <raag.jadav@intel.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent a0d78ee commit cdcc09a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

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)