From: Viresh Kumar Date: Thu, 4 Dec 2014 04:11:54 +0000 (+0530) Subject: thermal: cpu_cooling: propagate error returned by idr_alloc() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=268ac445ee1b2b7c2806e7a21076e6d94aca1ca3;p=linux-beck.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 Signed-off-by: Eduardo Valentin --- diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index d57b8bb7d423..5c9a2efeec22 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -485,7 +485,7 @@ __cpufreq_cooling_register(struct device_node *np, ret = get_idr(&cpufreq_idr, &cpufreq_dev->id); if (ret) { kfree(cpufreq_dev); - return ERR_PTR(-EINVAL); + return ERR_PTR(ret); } snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",