aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/sparse-keymap.c
diff options
context:
space:
mode:
authorRaag Jadav <[email protected]>2025-02-12 06:25:12 +0000
committerAndy Shevchenko <[email protected]>2025-02-24 10:08:52 +0000
commitcdcc09a495a4fa60f1c612db207d78b82b6c4531 (patch)
treedfcbcee04d786b96063dbe7a173c1f03c81f0264 /drivers/input/sparse-keymap.c
parentiio: adc: xilinx-xadc-core: use devm_kmemdup_array() (diff)
downloadkernel-cdcc09a495a4fa60f1c612db207d78b82b6c4531.tar.gz
kernel-cdcc09a495a4fa60f1c612db207d78b82b6c4531.zip
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]>
Diffstat (limited to 'drivers/input/sparse-keymap.c')
-rw-r--r--drivers/input/sparse-keymap.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c
index 25bf8be6e711..96f23ae57d5a 100644
--- a/drivers/input/sparse-keymap.c
+++ b/drivers/input/sparse-keymap.c
@@ -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;