mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
lpm-levels: Remove kfree for memory allocated with devm_kzalloc
Do not use kfree for memory allocated with devm_kzalloc during failures as device memory will get freed in device release. Change-Id: I6c4d3f8ed55ab02e3e70a1fe65452a8817c8b64e Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
This commit is contained in:
parent
2b6a49e9a1
commit
46f8d897d4
@ -709,7 +709,7 @@ static int parse_cpu(struct device_node *node, struct lpm_cpu *cpu)
|
||||
|
||||
static int parse_cpu_levels(struct device_node *node, struct lpm_cluster *c)
|
||||
{
|
||||
int ret, i;
|
||||
int ret;
|
||||
char *key;
|
||||
struct lpm_cpu *cpu;
|
||||
|
||||
@ -725,12 +725,12 @@ static int parse_cpu_levels(struct device_node *node, struct lpm_cluster *c)
|
||||
key = "qcom,psci-mode-shift";
|
||||
ret = of_property_read_u32(node, key, &cpu->psci_mode_shift);
|
||||
if (ret)
|
||||
goto failed_parse_params;
|
||||
goto failed;
|
||||
|
||||
key = "qcom,psci-mode-mask";
|
||||
ret = of_property_read_u32(node, key, &cpu->psci_mode_mask);
|
||||
if (ret)
|
||||
goto failed_parse_params;
|
||||
goto failed;
|
||||
|
||||
key = "qcom,disable-prediction";
|
||||
cpu->lpm_prediction = !(of_property_read_bool(node, key));
|
||||
@ -758,20 +758,14 @@ static int parse_cpu_levels(struct device_node *node, struct lpm_cluster *c)
|
||||
key = "parse_cpu";
|
||||
ret = parse_cpu(node, cpu);
|
||||
if (ret)
|
||||
goto failed_parse_cpu;
|
||||
goto failed;
|
||||
|
||||
cpumask_or(&c->child_cpus, &c->child_cpus, &cpu->related_cpus);
|
||||
list_add(&cpu->list, &c->cpu);
|
||||
|
||||
return ret;
|
||||
|
||||
failed_parse_cpu:
|
||||
for (i = 0; i < cpu->nlevels; i++) {
|
||||
kfree(cpu->levels[i].name);
|
||||
cpu->levels[i].name = NULL;
|
||||
}
|
||||
|
||||
failed_parse_params:
|
||||
failed:
|
||||
pr_err("Failed to read key: %s node: %s\n", key, node->name);
|
||||
return ret;
|
||||
}
|
||||
@ -786,15 +780,8 @@ void free_cluster_node(struct lpm_cluster *cluster)
|
||||
free_cluster_node(cl);
|
||||
};
|
||||
|
||||
list_for_each_entry_safe(cpu, n, &cluster->cpu, list) {
|
||||
int i;
|
||||
|
||||
list_for_each_entry_safe(cpu, n, &cluster->cpu, list)
|
||||
list_del(&cpu->list);
|
||||
for (i = 0; i < cpu->nlevels; i++) {
|
||||
kfree(cpu->levels[i].name);
|
||||
cpu->levels[i].name = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -886,7 +873,6 @@ failed_parse_cluster:
|
||||
list_del(&c->list);
|
||||
free_cluster_node(c);
|
||||
failed_parse_params:
|
||||
c->parent = NULL;
|
||||
pr_err("Failed parse params\n");
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user