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 <yashsuthar983@gmail.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
This commit is contained in:
Yash Suthar 2026-04-19 00:41:24 +05:30 committed by Linus Walleij
parent 3c8e7ba0e3
commit 728bf8ecac

View File

@ -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;