mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
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:
parent
3c8e7ba0e3
commit
728bf8ecac
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user