linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] add missing of_node_put
@ 2023-09-07  9:55 Julia Lawall
  2023-09-07  9:55 ` [PATCH 03/11] powerpc/powermac: " Julia Lawall
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Julia Lawall @ 2023-09-07  9:55 UTC (permalink / raw)
  To: alsa-devel
  Cc: linux-pm, netdev, dri-devel, Amit Kucheria, kernel-janitors,
	linux-kernel, Nicholas Piggin, linux-mediatek,
	bcm-kernel-feedback-list, linux-mmc, Zhang Rui, linux-media,
	linuxppc-dev, linux-arm-kernel, AngeloGioacchino Del Regno

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 03/11] powerpc/powermac: add missing of_node_put
  2023-09-07  9:55 [PATCH 00/11] add missing of_node_put Julia Lawall
@ 2023-09-07  9:55 ` Julia Lawall
  2023-09-07  9:55 ` [PATCH 06/11] powerpc/kexec_file: " Julia Lawall
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2023-09-07  9:55 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, kernel-janitors, Nicholas Piggin, linux-kernel

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

---
 arch/powerpc/platforms/powermac/low_i2c.c |    4 +++-
 arch/powerpc/platforms/powermac/smp.c     |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff -u -p a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -598,8 +598,10 @@ static void __init smp_core99_setup_i2c_
 			name = "Pulsar";
 			break;
 		}
-		if (pmac_tb_freeze != NULL)
+		if (pmac_tb_freeze != NULL) {
+			of_node_put(cc);
 			break;
+		}
 	}
 	if (pmac_tb_freeze != NULL) {
 		/* Open i2c bus for synchronous access */
diff -u -p a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -925,8 +925,10 @@ static void __init smu_i2c_probe(void)
 
 		sz = sizeof(struct pmac_i2c_bus) + sizeof(struct smu_i2c_cmd);
 		bus = kzalloc(sz, GFP_KERNEL);
-		if (bus == NULL)
+		if (bus == NULL) {
+			of_node_put(busnode);
 			return;
+		}
 
 		bus->controller = controller;
 		bus->busnode = of_node_get(busnode);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 06/11] powerpc/kexec_file: add missing of_node_put
  2023-09-07  9:55 [PATCH 00/11] add missing of_node_put Julia Lawall
  2023-09-07  9:55 ` [PATCH 03/11] powerpc/powermac: " Julia Lawall
@ 2023-09-07  9:55 ` Julia Lawall
  2023-09-10 18:00 ` [PATCH 00/11] " patchwork-bot+netdevbpf
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2023-09-07  9:55 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, kernel-janitors, Nicholas Piggin, linux-kernel

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

---
 arch/powerpc/kexec/file_load_64.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff -u -p a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c
--- a/arch/powerpc/kexec/file_load_64.c
+++ b/arch/powerpc/kexec/file_load_64.c
@@ -1138,11 +1138,15 @@ static int update_pci_dma_nodes(void *fd
 			continue;
 
 		ret = copy_property(fdt, pci_offset, dn, "ibm,dma-window");
-		if (ret < 0)
+		if (ret < 0) {
+			of_node_put(dn);
 			break;
+		}
 		ret = copy_property(fdt, pci_offset, dn, dmapropname);
-		if (ret < 0)
+		if (ret < 0) {
+			of_node_put(dn);
 			break;
+		}
 	}
 
 	return ret;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 00/11] add missing of_node_put
  2023-09-07  9:55 [PATCH 00/11] add missing of_node_put Julia Lawall
  2023-09-07  9:55 ` [PATCH 03/11] powerpc/powermac: " Julia Lawall
  2023-09-07  9:55 ` [PATCH 06/11] powerpc/kexec_file: " Julia Lawall
@ 2023-09-10 18:00 ` patchwork-bot+netdevbpf
  2023-09-11 15:08 ` (subset) " Mark Brown
  2023-09-21  9:30 ` Michael Ellerman
  4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-09-10 18:00 UTC (permalink / raw)
  To: Julia Lawall
  Cc: alsa-devel, linux-pm, netdev, dri-devel, amitk, kernel-janitors,
	linux-kernel, npiggin, linux-mediatek, bcm-kernel-feedback-list,
	linux-mmc, rui.zhang, linux-media, linuxppc-dev, linux-arm-kernel,
	angelogioacchino.delregno

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: (subset) [PATCH 00/11] add missing of_node_put
  2023-09-07  9:55 [PATCH 00/11] add missing of_node_put Julia Lawall
                   ` (2 preceding siblings ...)
  2023-09-10 18:00 ` [PATCH 00/11] " patchwork-bot+netdevbpf
@ 2023-09-11 15:08 ` Mark Brown
  2023-09-21  9:30 ` Michael Ellerman
  4 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2023-09-11 15:08 UTC (permalink / raw)
  To: alsa-devel, Julia Lawall
  Cc: linux-pm, netdev, dri-devel, Amit Kucheria, kernel-janitors,
	linux-kernel, Nicholas Piggin, linux-mediatek,
	bcm-kernel-feedback-list, linux-mmc, Zhang Rui, linux-media,
	linuxppc-dev, linux-arm-kernel, AngeloGioacchino Del Regno

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 00/11] add missing of_node_put
  2023-09-07  9:55 [PATCH 00/11] add missing of_node_put Julia Lawall
                   ` (3 preceding siblings ...)
  2023-09-11 15:08 ` (subset) " Mark Brown
@ 2023-09-21  9:30 ` Michael Ellerman
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2023-09-21  9:30 UTC (permalink / raw)
  To: alsa-devel, Julia Lawall
  Cc: linux-pm, netdev, dri-devel, Amit Kucheria, kernel-janitors,
	linux-kernel, Nicholas Piggin, linux-mediatek,
	bcm-kernel-feedback-list, linux-mmc, Zhang Rui, linux-media,
	linuxppc-dev, linux-arm-kernel, AngeloGioacchino Del Regno

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-09-21  9:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-07  9:55 [PATCH 00/11] add missing of_node_put Julia Lawall
2023-09-07  9:55 ` [PATCH 03/11] powerpc/powermac: " Julia Lawall
2023-09-07  9:55 ` [PATCH 06/11] powerpc/kexec_file: " Julia Lawall
2023-09-10 18:00 ` [PATCH 00/11] " patchwork-bot+netdevbpf
2023-09-11 15:08 ` (subset) " Mark Brown
2023-09-21  9:30 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).