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: f6859014c7e7 ("thermal: cpu_cooling: Store frequencies in descending order")
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Eduardo Valentin <[email protected]>
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;
}