|
@@ -295,8 +295,7 @@ static int zx_pinctrl_build_state(struct platform_device *pdev)
|
|
pctldev->num_groups = ngroups;
|
|
pctldev->num_groups = ngroups;
|
|
|
|
|
|
/* Build function list from pin mux functions */
|
|
/* Build function list from pin mux functions */
|
|
- functions = devm_kzalloc(&pdev->dev, info->npins * sizeof(*functions),
|
|
|
|
- GFP_KERNEL);
|
|
|
|
|
|
+ functions = kcalloc(info->npins, sizeof(*functions), GFP_KERNEL);
|
|
if (!functions)
|
|
if (!functions)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|
|
@@ -367,8 +366,10 @@ static int zx_pinctrl_build_state(struct platform_device *pdev)
|
|
func->num_group_names *
|
|
func->num_group_names *
|
|
sizeof(*func->group_names),
|
|
sizeof(*func->group_names),
|
|
GFP_KERNEL);
|
|
GFP_KERNEL);
|
|
- if (!func->group_names)
|
|
|
|
|
|
+ if (!func->group_names) {
|
|
|
|
+ kfree(functions);
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
group = func->group_names;
|
|
group = func->group_names;
|