mirror of https://gitee.com/openkylin/linux.git
thermal: cpu_cooling: propagate error returned by idr_alloc()
We aren't supposed to return our own error type here. Return what we got. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
This commit is contained in:
parent
8e54d442fe
commit
268ac445ee
|
@ -485,7 +485,7 @@ __cpufreq_cooling_register(struct device_node *np,
|
||||||
ret = get_idr(&cpufreq_idr, &cpufreq_dev->id);
|
ret = get_idr(&cpufreq_idr, &cpufreq_dev->id);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
kfree(cpufreq_dev);
|
kfree(cpufreq_dev);
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",
|
snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",
|
||||||
|
|
Loading…
Reference in New Issue