mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
pinctrl: pinconf-generic: Use kmemdup instead of kmalloc + memcpy
This issue was reported by coccicheck using the semantic patch at scripts/coccinelle/api/memdup.cocci Signed-off-by: Benoit Taine <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
49cfabc20a
commit
db388dfb90
1 changed files with 1 additions and 2 deletions
|
|
@ -228,13 +228,12 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
|
|||
* Now limit the number of configs to the real number of
|
||||
* found properties.
|
||||
*/
|
||||
*configs = kzalloc(ncfg * sizeof(unsigned long), GFP_KERNEL);
|
||||
*configs = kmemdup(cfg, ncfg * sizeof(unsigned long), GFP_KERNEL);
|
||||
if (!*configs) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
memcpy(*configs, cfg, ncfg * sizeof(unsigned long));
|
||||
*nconfigs = ncfg;
|
||||
|
||||
out:
|
||||
|
|
|
|||
Loading…
Reference in a new issue