diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-10-25 21:55:42 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2014-09-25 17:59:26 +0800 |
commit | e6ac9c53208c2871e3704e5b911971522cda8a56 (patch) | |
tree | 59f077a16616e947e0bcdac8f51743ac2f6b6d96 | |
parent | c60fd301f395adc8f788be8b192a58f0246ddbae (diff) |
thermal: cpu_cooling: fix return value check in cpufreq_cooling_register()
In case of error, the function thermal_cooling_device_register() returns
ERR_PTR() and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
(cherry picked from commit 73b9bcd76d13716cc0e0ab053f8c1ae41f47636e)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
drivers/thermal/cpu_cooling.c
-rw-r--r-- | drivers/thermal/cpu_cooling.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index dc50315174d8..8c1547424502 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -482,7 +482,7 @@ __cpufreq_cooling_register(struct device_node *np, if (IS_ERR(cool_dev)) { release_idr(&cpufreq_idr, cpufreq_dev->id); kfree(cpufreq_dev); - return ERR_PTR(-EINVAL); + return cool_dev; } cpufreq_dev->cool_dev = cool_dev; cpufreq_dev->cpufreq_state = 0; |