cpufreq: tegra124: add missing of_node_put()
Subsystems (2)
PATCH 1/1 cpufreq: tegra124: add missing of_node_put()
of_cpu_device_node_get() will increase the refcount of device_node, it is necessary to call of_node_put() at the end to release the refcount.
--- drivers/cpufreq/tegra124-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/cpufreq/tegra124-cpufreq.c +2 -0
@@ -118,6 +118,8 @@ static int tegra124_cpufreq_probe(struct platform_device *pdev) goto out_put_pllx_clk; } +of_node_put (np); + ret =tegra124_cpu_switch_to_dfll (priv);if (ret) goto out_put_pllp_clk;
Signature · 1 line
2.17.0
Viresh Kumar
maintainerQuoted 14 lines · Yangtao Li
of_cpu_device_node_get()will increase the refcount ofdevice_node, it is necessary to callof_node_put()at the end to release the refcount.Signed-off-by Yangtao Li <[email protected]>--- drivers/cpufreq/tegra124-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+)drivers/cpufreq/tegra124-cpufreq.c +0
-0
drivers/cpufreq/tegra124-cpufreq.c static int tegra124_cpufreq_probe(struct platform_device *pdev) · line 125
Quoted 8 lines
drivers/cpufreq/tegra124-cpufreq.c +2
-0@@ -118,6 +118,8 @@ static int tegra124_cpufreq_probe(struct platform_device *pdev) goto out_put_pllx_clk; } +of_node_put (np); + ret =tegra124_cpu_switch_to_dfll (priv);if (ret) goto out_put_pllp_clk;
Fixes and stable tags ?
Signature · 1 line
viresh
Quoted 19 lines · Viresh Kumar
Quoted 17 lines · Yangtao Li
of_cpu_device_node_get()will increase the refcount ofdevice_node, it is necessary to callof_node_put()at the end to release the refcount.Signed-off-by Yangtao Li <[email protected]>--- drivers/cpufreq/tegra124-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+)drivers/cpufreq/tegra124-cpufreq.c +0
-0@@ -118,6 +118,8 @@ static int tegra124_cpufreq_probe(struct platform_device *pdev) goto out_put_pllx_clk; }
Quoted 7 lines
drivers/cpufreq/tegra124-cpufreq.c static int tegra124_cpufreq_probe(struct platform_device *pdev) · line 125
Quoted 5 lines
drivers/cpufreq/tegra124-cpufreq.c +2
-0+of_node_put (np); + ret =tegra124_cpu_switch_to_dfll (priv);if (ret) goto out_put_pllp_clk;Fixes and stable tags ?
Hi viresh,
Like this?
MBR,
Yangtao
Quoted 3 lines
--
viresh
Viresh Kumar
maintainerQuoted 27 lines · Frank Lee
Quoted 19 lines · Viresh Kumar
Quoted 17 lines · Yangtao Li
of_cpu_device_node_get()will increase the refcount ofdevice_node, it is necessary to callof_node_put()at the end to release the refcount.Signed-off-by Yangtao Li <[email protected]>--- drivers/cpufreq/tegra124-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+)drivers/cpufreq/tegra124-cpufreq.c +0
-0@@ -118,6 +118,8 @@ static int tegra124_cpufreq_probe(struct platform_device *pdev) goto out_put_pllx_clk; }Quoted 7 lines
drivers/cpufreq/tegra124-cpufreq.c static int tegra124_cpufreq_probe(struct platform_device *pdev) · line 125
Quoted 5 lines
drivers/cpufreq/tegra124-cpufreq.c +2
-0+of_node_put (np); + ret =tegra124_cpu_switch_to_dfll (priv);if (ret) goto out_put_pllp_clk;Fixes and stable tags ?
Quoted 6 lines
Hi viresh,
Like this?
Fixes 9eb15dbbfa1a2 ("cpufreq: Add cpufreq driver for Tegra124")
This needs to be something like:
Also I don't think your patch is entirely correct as we will end up doing of_node_put() twice in error path.
Signature · 1 line
viresh
Quoted 36 lines · Viresh Kumar
Quoted 27 lines · Frank Lee
Quoted 19 lines · Viresh Kumar
Quoted 17 lines · Yangtao Li
of_cpu_device_node_get()will increase the refcount ofdevice_node, it is necessary to callof_node_put()at the end to release the refcount.Signed-off-by Yangtao Li <[email protected]>--- drivers/cpufreq/tegra124-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+)drivers/cpufreq/tegra124-cpufreq.c +0
-0@@ -118,6 +118,8 @@ static int tegra124_cpufreq_probe(struct platform_device *pdev) goto out_put_pllx_clk; }Quoted 7 lines
drivers/cpufreq/tegra124-cpufreq.c static int tegra124_cpufreq_probe(struct platform_device *pdev) · line 125
Quoted 5 lines
drivers/cpufreq/tegra124-cpufreq.c +2
-0+of_node_put (np); + ret =tegra124_cpu_switch_to_dfll (priv);if (ret) goto out_put_pllp_clk;Fixes and stable tags ?
Quoted 6 lines
Hi viresh,
Like this?
Fixes 9eb15dbbfa1a2 ("cpufreq: Add cpufreq driver for Tegra124")
Quoted 6 lines
This needs to be something like:
Cc 4.5+ [email protected] #4.5+Also I don't think your patch is entirely correct as we will end up doing
of_node_put()twice in error path.
Thanks for your reminder, I will modify it immediately.
MBR,
Yangtao
Quoted 3 lines
--
viresh
Quoted 14 lines · Yangtao Li
of_cpu_device_node_get()will increase the refcount ofdevice_node, it is necessary to callof_node_put()at the end to release the refcount.Signed-off-by Yangtao Li <[email protected]>--- drivers/cpufreq/tegra124-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+)drivers/cpufreq/tegra124-cpufreq.c +0
-0
drivers/cpufreq/tegra124-cpufreq.c static int tegra124_cpufreq_probe(struct platform_device *pdev) · line 125
Quoted 8 lines
drivers/cpufreq/tegra124-cpufreq.c +2
-0@@ -118,6 +118,8 @@ static int tegra124_cpufreq_probe(struct platform_device *pdev) goto out_put_pllx_clk; } +of_node_put (np); + ret =tegra124_cpu_switch_to_dfll (priv);if (ret) goto out_put_pllp_clk;
I think this needs to move to the very end of the function, for example after the call to platform_set_drvdata(), to avoid releasing it twice in error paths.
Thierry