[PATCH 00/11] add missing of_node_put
Add of_node_put on a break out of an of_node loop.
---
arch/powerpc/kexec/file_load_64.c | 8 ++++++-- arch/powerpc/platforms/powermac/low_i2c.c | 4 +++- arch/powerpc/platforms/powermac/smp.c | 4 +++- drivers/bus/arm-cci.c | 4 +++- drivers/genpd/ti/ti_sci_pm_domains.c | 8 ++++++-- drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 4 +++- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 4 +++- drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 1 + drivers/mmc/host/atmel-mci.c | 8 ++++++-- drivers/net/ethernet/broadcom/asp2/bcmasp.c | 1 + drivers/soc/dove/pmu.c | 5 ++++- drivers/thermal/thermal_of.c | 8 ++++++-- sound/soc/sh/rcar/core.c | 1 + 13 files changed, 46 insertions(+), 14 deletions(-)
for_each_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put.
This was done using the Coccinelle semantic patch iterators/for_each_child.cocci
Signed-off-by: Julia Lawall Julia.Lawall@inria.fr
--- sound/soc/sh/rcar/core.c | 1 + 1 file changed, 1 insertion(+)
diff -u -p a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1303,6 +1303,7 @@ audio_graph: if (i >= RSND_MAX_COMPONENT) { dev_info(dev, "reach to max component\n"); of_node_put(node); + of_node_put(ports); break; } }
Hi Julia
Thank you for the patch
for_each_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put.
This was done using the Coccinelle semantic patch iterators/for_each_child.cocci
Signed-off-by: Julia Lawall Julia.Lawall@inria.fr
sound/soc/sh/rcar/core.c | 1 + 1 file changed, 1 insertion(+)
diff -u -p a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1303,6 +1303,7 @@ audio_graph: if (i >= RSND_MAX_COMPONENT) { dev_info(dev, "reach to max component\n"); of_node_put(node);
} }of_node_put(ports); break;
Acked-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
I noticed that existing "of_node_put(node)" itself is not needed. We can remove it, and I will post the patch next week.
Thank you for your help !!
Best regards --- Kuninori Morimoto
On Fri, 8 Sep 2023, Kuninori Morimoto wrote:
Hi Julia
Thank you for the patch
for_each_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put.
This was done using the Coccinelle semantic patch iterators/for_each_child.cocci
Signed-off-by: Julia Lawall Julia.Lawall@inria.fr
sound/soc/sh/rcar/core.c | 1 + 1 file changed, 1 insertion(+)
diff -u -p a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1303,6 +1303,7 @@ audio_graph: if (i >= RSND_MAX_COMPONENT) { dev_info(dev, "reach to max component\n"); of_node_put(node);
} }of_node_put(ports); break;
Acked-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
I noticed that existing "of_node_put(node)" itself is not needed. We can remove it, and I will post the patch next week.
Oops, indeed the better way to make the change would have been to convert node to ports. It's just a copy paste error with respect to the code above the audio_graph label. Do you want me to send this change instead?
julia
Thank you for your help !!
Best regards
Kuninori Morimoto
Hi Julia, Mark
Thank you for your feedback
I noticed that existing "of_node_put(node)" itself is not needed. We can remove it, and I will post the patch next week.
Oops, indeed the better way to make the change would have been to convert node to ports. It's just a copy paste error with respect to the code above the audio_graph label. Do you want me to send this change instead?
No problem "add missing no_node_put()" and "remove unneeded no_node_put()" are mutual independent, it can be separate patch, I think.
Thank you for your help !!
Best regards --- Kuninori Morimoto
Hello:
This patch was applied to netdev/net.git (main) by David S. Miller davem@davemloft.net:
On Thu, 7 Sep 2023 11:55:10 +0200 you wrote:
Add of_node_put on a break out of an of_node loop.
arch/powerpc/kexec/file_load_64.c | 8 ++++++-- arch/powerpc/platforms/powermac/low_i2c.c | 4 +++- arch/powerpc/platforms/powermac/smp.c | 4 +++- drivers/bus/arm-cci.c | 4 +++- drivers/genpd/ti/ti_sci_pm_domains.c | 8 ++++++-- drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 4 +++- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 4 +++- drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 1 + drivers/mmc/host/atmel-mci.c | 8 ++++++-- drivers/net/ethernet/broadcom/asp2/bcmasp.c | 1 + drivers/soc/dove/pmu.c | 5 ++++- drivers/thermal/thermal_of.c | 8 ++++++-- sound/soc/sh/rcar/core.c | 1 + 13 files changed, 46 insertions(+), 14 deletions(-)
Here is the summary with links: - [02/11] net: bcmasp: add missing of_node_put https://git.kernel.org/netdev/net/c/e73d1ab6cd7e
You are awesome, thank you!
On Thu, 07 Sep 2023 11:55:10 +0200, Julia Lawall wrote:
Add of_node_put on a break out of an of_node loop.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[10/11] ASoC: rsnd: add missing of_node_put commit: 28115b1c4f2bb76e786436bf6597c5eb27638a5c
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
On Thu, 07 Sep 2023 11:55:10 +0200, Julia Lawall wrote:
Add of_node_put on a break out of an of_node loop.
Patches 3 and 6 applied to powerpc/next.
[03/11] powerpc/powermac: add missing of_node_put https://git.kernel.org/powerpc/c/a59e9eb25216eb1dc99e14fc31b76aa648d79540 [06/11] powerpc/kexec_file: add missing of_node_put https://git.kernel.org/powerpc/c/06b627c1236216ac1239c5e1afcc75359af3fb72
cheers
participants (5)
-
Julia Lawall
-
Kuninori Morimoto
-
Mark Brown
-
Michael Ellerman
-
patchwork-bot+netdevbpf@kernel.org