diff mbox

[11/26] cpu_cooling: propagate error returned by idr_alloc()

Message ID 1cfc99a9a641f2937a8ac95c6b784e3eee033b0c.1417167599.git.viresh.kumar@linaro.org
State New
Headers show

Commit Message

Viresh Kumar Nov. 28, 2014, 9:44 a.m. UTC
We aren't supposed to return our own error type here. Return what we got.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/thermal/cpu_cooling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Viresh Kumar Dec. 3, 2014, 4:36 a.m. UTC | #1
On 2 December 2014 at 21:05, Javi Merino <javi.merino@arm.com> wrote:
> The error is ret, not the id which is probably 0 if there was an
> error. So:
>
> +               return ERR_PTR(ret);

Where should I hide my face, shameful mistake :(
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index bb11dd4..964586f 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -477,7 +477,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(cpufreq_dev->id);
 	}
 
 	snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",