mirror of
https://github.com/torvalds/linux.git
synced 2025-04-12 06:49:52 +00:00
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>
This commit is contained in:
parent
a0d78eec88
commit
cdcc09a495
@ -176,8 +176,7 @@ int sparse_keymap_setup(struct input_dev *dev,
|
||||
for (e = keymap; e->type != KE_END; e++)
|
||||
map_size++;
|
||||
|
||||
map = devm_kmemdup(&dev->dev, keymap, map_size * sizeof(*map),
|
||||
GFP_KERNEL);
|
||||
map = devm_kmemdup_array(&dev->dev, keymap, map_size, sizeof(*keymap), GFP_KERNEL);
|
||||
if (!map)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user