linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: rsnd: Fix an error handling path in 'rsnd_node_count()'
@ 2021-10-18 19:44 Christophe JAILLET
  2021-10-18 23:13 ` Kuninori Morimoto
  2021-11-02 18:30 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2021-10-18 19:44 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, kuninori.morimoto.gx,
	mikhail_durnev, joe, pierre-louis.bossart
  Cc: alsa-devel, linux-kernel, kernel-janitors, Christophe JAILLET

If we return before the end of the 'for_each_child_of_node()' iterator, the
reference taken on 'np' must be released.

Add the missing 'of_node_put()' call.

Fixes: c413983eb66a ("ASoC: rsnd: adjust disabled module")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 sound/soc/sh/rcar/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 978bd0406729..6a8fe0da7670 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1225,6 +1225,7 @@ int rsnd_node_count(struct rsnd_priv *priv, struct device_node *node, char *name
 		if (i < 0) {
 			dev_err(dev, "strange node numbering (%s)",
 				of_node_full_name(node));
+			of_node_put(np);
 			return 0;
 		}
 		i++;
-- 
2.30.2


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

* Re: [PATCH] ASoC: rsnd: Fix an error handling path in 'rsnd_node_count()'
  2021-10-18 19:44 [PATCH] ASoC: rsnd: Fix an error handling path in 'rsnd_node_count()' Christophe JAILLET
@ 2021-10-18 23:13 ` Kuninori Morimoto
  2021-11-02 18:30 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2021-10-18 23:13 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: lgirdwood, broonie, perex, tiwai, mikhail_durnev, joe,
	pierre-louis.bossart, alsa-devel, linux-kernel, kernel-janitors


Hi

> If we return before the end of the 'for_each_child_of_node()' iterator, the
> reference taken on 'np' must be released.
> 
> Add the missing 'of_node_put()' call.
> 
> Fixes: c413983eb66a ("ASoC: rsnd: adjust disabled module")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---

Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH] ASoC: rsnd: Fix an error handling path in 'rsnd_node_count()'
  2021-10-18 19:44 [PATCH] ASoC: rsnd: Fix an error handling path in 'rsnd_node_count()' Christophe JAILLET
  2021-10-18 23:13 ` Kuninori Morimoto
@ 2021-11-02 18:30 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-11-02 18:30 UTC (permalink / raw)
  To: pierre-louis.bossart, kuninori.morimoto.gx, tiwai,
	Christophe JAILLET, perex, lgirdwood, mikhail_durnev, joe
  Cc: kernel-janitors, alsa-devel, linux-kernel

On Mon, 18 Oct 2021 21:44:16 +0200, Christophe JAILLET wrote:
> If we return before the end of the 'for_each_child_of_node()' iterator, the
> reference taken on 'np' must be released.
> 
> Add the missing 'of_node_put()' call.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: rsnd: Fix an error handling path in 'rsnd_node_count()'
      commit: 173632358fde7a567f28e07c4549b959ee857986

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] 3+ messages in thread

end of thread, other threads:[~2021-11-02 18:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 19:44 [PATCH] ASoC: rsnd: Fix an error handling path in 'rsnd_node_count()' Christophe JAILLET
2021-10-18 23:13 ` Kuninori Morimoto
2021-11-02 18:30 ` Mark Brown

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