Commit b45fd13b authored by Anson Huang's avatar Anson Huang Committed by Daniel Lezcano

thermal/drivers: imx: Fix missing of_node_put() at probe time

After finishing using cpu node got from of_get_cpu_node(), of_node_put()
needs to be called.
Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/1585232945-23368-1-git-send-email-Anson.Huang@nxp.com
parent 9ebcfadb
...@@ -649,7 +649,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match); ...@@ -649,7 +649,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match);
static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
{ {
struct device_node *np; struct device_node *np;
int ret; int ret = 0;
data->policy = cpufreq_cpu_get(0); data->policy = cpufreq_cpu_get(0);
if (!data->policy) { if (!data->policy) {
...@@ -664,11 +664,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) ...@@ -664,11 +664,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
if (IS_ERR(data->cdev)) { if (IS_ERR(data->cdev)) {
ret = PTR_ERR(data->cdev); ret = PTR_ERR(data->cdev);
cpufreq_cpu_put(data->policy); cpufreq_cpu_put(data->policy);
return ret;
} }
} }
return 0; of_node_put(np);
return ret;
} }
static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data) static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment