diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-12-17 02:55:53 +0300 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2015-06-05 15:42:34 -0700 |
commit | 5caf193b157531a26215dda7d4f7311989c1b9db (patch) | |
tree | 41b63526aa0107d0c55d910dea6f077258c44b5b | |
parent | 41acfdc9e3de851eada47b27a376198bb830b4af (diff) |
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: f6859014c7e7 ("thermal: cpu_cooling: Store frequencies in descending order")
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
(cherry picked from commit 2d2e95ea8f124869b96ad929d1701bd64844a06a)
Signed-off-by: Kevin Hilman <khilman@linaro.org>
-rw-r--r-- | drivers/thermal/cpu_cooling.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 051eb4821bc7..9b45f6426f44 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -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; } |