Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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

authored by

Anson Huang and committed by
Daniel Lezcano
b45fd13b 9ebcfadb

+4 -3
+4 -3
drivers/thermal/imx_thermal.c
··· 649 649 static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) 650 650 { 651 651 struct device_node *np; 652 - int ret; 652 + int ret = 0; 653 653 654 654 data->policy = cpufreq_cpu_get(0); 655 655 if (!data->policy) { ··· 664 664 if (IS_ERR(data->cdev)) { 665 665 ret = PTR_ERR(data->cdev); 666 666 cpufreq_cpu_put(data->policy); 667 - return ret; 668 667 } 669 668 } 670 669 671 - return 0; 670 + of_node_put(np); 671 + 672 + return ret; 672 673 } 673 674 674 675 static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data)