From: Yash Suthar Date: Sat, 18 Apr 2026 19:11:24 +0000 (+0530) Subject: pinctrl: pinconf-generic: Use kmemdup_array() over kmemdup() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=728bf8ecac7733848a214b95b1aba41e0ee3ffb9;p=thirdparty%2Fkernel%2Flinux.git pinctrl: pinconf-generic: Use kmemdup_array() over kmemdup() using kmemdup_array instead of kmemdup ,as it is more readable and matches the intent of the api. tested with w=1, no new warnings introduced. Signed-off-by: Yash Suthar Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 64ed283097887..d333ddd442987 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -419,7 +419,7 @@ int pinconf_generic_parse_dt_config(struct device_node *np, * Now limit the number of configs to the real number of * found properties. */ - *configs = kmemdup(cfg, ncfg * sizeof(unsigned long), GFP_KERNEL); + *configs = kmemdup_array(cfg, ncfg, sizeof(unsigned long), GFP_KERNEL); if (!*configs) { ret = -ENOMEM; goto out;