Skip to content

Commit b45fd13

Browse files
Anson-Huangdlezcano
authored andcommitted
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: Anson Huang <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9ebcfad commit b45fd13

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/thermal/imx_thermal.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match);
649649
static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
650650
{
651651
struct device_node *np;
652-
int ret;
652+
int ret = 0;
653653

654654
data->policy = cpufreq_cpu_get(0);
655655
if (!data->policy) {
@@ -664,11 +664,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
664664
if (IS_ERR(data->cdev)) {
665665
ret = PTR_ERR(data->cdev);
666666
cpufreq_cpu_put(data->policy);
667-
return ret;
668667
}
669668
}
670669

671-
return 0;
670+
of_node_put(np);
671+
672+
return ret;
672673
}
673674

674675
static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data)

0 commit comments

Comments
 (0)