Skip to content

Commit

Permalink
thermal/drivers: imx: Fix missing of_node_put() at probe time
Browse files Browse the repository at this point in the history
After finishing using cpu node got from of_get_cpu_node(), of_node_put()
needs to be called.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/1585232945-23368-1-git-send-email-Anson.Huang@nxp.com
  • Loading branch information
Anson Huang authored and Daniel Lezcano committed Jun 29, 2020
1 parent 9ebcfad commit b45fd13
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/thermal/imx_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match);
static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
{
struct device_node *np;
int ret;
int ret = 0;

data->policy = cpufreq_cpu_get(0);
if (!data->policy) {
Expand All @@ -664,11 +664,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
if (IS_ERR(data->cdev)) {
ret = PTR_ERR(data->cdev);
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)
Expand Down

0 comments on commit b45fd13

Please sign in to comment.