All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: soc-core: protect dlc->of_node under mutex
@ 2023-06-29 23:52 Kuninori Morimoto
  2023-07-12 11:47 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Kuninori Morimoto @ 2023-06-29 23:52 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

dlc->of_node will be set on snd_soc_get_dlc(), but we want
1) protect it by mutex, 2) set only when successed.
This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 11bc5250ffd0..fcc798e0b8f0 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3262,8 +3262,6 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_
 	struct snd_soc_component *pos;
 	int ret = -EPROBE_DEFER;
 
-	dlc->of_node = args->np;
-
 	mutex_lock(&client_mutex);
 	for_each_component(pos) {
 		struct device_node *component_of_node = soc_component_to_node(pos);
@@ -3317,6 +3315,10 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_
 
 		break;
 	}
+
+	if (ret == 0)
+		dlc->of_node = args->np;
+
 	mutex_unlock(&client_mutex);
 	return ret;
 }
-- 
2.25.1


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

* Re: [PATCH] ASoC: soc-core: protect dlc->of_node under mutex
  2023-06-29 23:52 [PATCH] ASoC: soc-core: protect dlc->of_node under mutex Kuninori Morimoto
@ 2023-07-12 11:47 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-07-12 11:47 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA

On Thu, 29 Jun 2023 23:52:20 +0000, Kuninori Morimoto wrote:
> dlc->of_node will be set on snd_soc_get_dlc(), but we want
> 1) protect it by mutex, 2) set only when successed.
> This patch do it.
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: soc-core: protect dlc->of_node under mutex
      commit: 065aa861b1243704b329a6d8407d8399614df6bd

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

end of thread, other threads:[~2023-07-12 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29 23:52 [PATCH] ASoC: soc-core: protect dlc->of_node under mutex Kuninori Morimoto
2023-07-12 11:47 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.