Commit 2d2e95ea authored by Dan Carpenter's avatar Dan Carpenter Committed by Eduardo Valentin

thermal: cpu_cooling: small memory leak on error

There was a left over return here so the error handling isn't run.
It leads to a small memory leak and a static checker warning.

	drivers/thermal/cpu_cooling.c:351 __cpufreq_cooling_register()
	info: ignoring unreachable code.

Fixes: f6859014 ("thermal: cpu_cooling: Store frequencies in descending order")
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent cffafc32
......@@ -347,7 +347,6 @@ __cpufreq_cooling_register(struct device_node *np,
cpufreq_dev->freq_table = kmalloc(sizeof(*cpufreq_dev->freq_table) *
cpufreq_dev->max_level, GFP_KERNEL);
if (!cpufreq_dev->freq_table) {
return ERR_PTR(-ENOMEM);
cool_dev = ERR_PTR(-ENOMEM);
goto free_cdev;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment