author: Daniel Lezcano <daniel.lezcano@linaro.org> 2021-03-19 21:25:22 +0100
committer: Daniel Lezcano <daniel.lezcano@linaro.org> 2021-04-15 13:21:26 +0200
commit: 6cc7b38c0ca3187abd07af849ec179b42337bcf6
parent: 9aa80ab2c0ba67ce3281aee604b543293f71390d
Commit Summary:
Diffstat:
1 file changed, 5 insertions, 3 deletions
diff --git a/drivers/thermal/cpuidle_cooling.c b/drivers/thermal/cpuidle_cooling.c
index f32976163bad..4f41102e8b16 100644
--- a/drivers/thermal/cpuidle_cooling.c
+++ b/drivers/thermal/cpuidle_cooling.c
@@ -208,18 +208,20 @@ static int __cpuidle_cooling_register(struct device_node *np,
cdev = thermal_of_cooling_device_register(np, name, idle_cdev,
&cpuidle_cooling_ops);
- kfree(name);
-
if (IS_ERR(cdev)) {
ret = PTR_ERR(cdev);
- goto out_unregister;
+ goto out_kfree_name;
}
pr_debug("%s: Idle injection set with idle duration=%u, latency=%u\n",
name, idle_duration_us, latency_us);
+ kfree(name);
+
return 0;
+out_kfree_name:
+ kfree(name);
out_unregister:
idle_inject_unregister(ii_dev);
out_kfree: