summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorShen Lichuan <shenlichuan@vivo.com>2024-08-22 07:41:56 +0300
committerLinus Walleij <linus.walleij@linaro.org>2024-08-26 11:27:52 +0300
commitca428f12c8eded243daeb10e6ff4be6bf4274617 (patch)
tree386322c5c1807bebeb02461abffa6f8043679073 /drivers/pinctrl
parent0f978da67aaeb86c1a3804ce533939b3f90530eb (diff)
downloadlinux-ca428f12c8eded243daeb10e6ff4be6bf4274617.tar.xz
drivers/pinctrl: Switch to use kmemdup_array()
Let the kememdup_array() take care about multiplication and possible overflows. Signed-off-by: Shen Lichuan <shenlichuan@vivo.com> Link: https://lore.kernel.org/20240822044156.2301-1-shenlichuan@vivo.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/pinctrl-utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-utils.c b/drivers/pinctrl/pinctrl-utils.c
index d81d7b46116c..b880e44b8221 100644
--- a/drivers/pinctrl/pinctrl-utils.c
+++ b/drivers/pinctrl/pinctrl-utils.c
@@ -70,8 +70,8 @@ int pinctrl_utils_add_map_configs(struct pinctrl_dev *pctldev,
if (WARN_ON(*num_maps == *reserved_maps))
return -ENOSPC;
- dup_configs = kmemdup(configs, num_configs * sizeof(*dup_configs),
- GFP_KERNEL);
+ dup_configs = kmemdup_array(configs, num_configs,
+ sizeof(*dup_configs), GFP_KERNEL);
if (!dup_configs)
return -ENOMEM;