diff mbox series

ASoC: audio-graph-card2: fix index check on graph_parse_node_multi_nm()

Message ID 87o7drdqux.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State Accepted
Commit 301bda18ac735eaaad5823dbdd067b3b2728c780
Headers show
Series ASoC: audio-graph-card2: fix index check on graph_parse_node_multi_nm() | expand

Commit Message

Kuninori Morimoto Jan. 12, 2024, 6:10 a.m. UTC
commit d685aea5e0a8 ("ASoC: audio-graph-card2: fix off by one in
graph_parse_node_multi_nm()") uses ">=" instead of ">" for index check,
but it was wrong. The nm_idx will be increment at end of loop,
thus, ">" is correct.

	while (1) {
		...
=>		if (*nm_idx > nm_max)
			break;
		...
		(*nm_idx)++;
	}

Without this patch, "Multi-Codec-1" sample on
${LINUX}/sound/soc/generic/audio-graph-card2-custom-sample.dtsi
will be error.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown Jan. 12, 2024, 4:52 p.m. UTC | #1
On Fri, 12 Jan 2024 06:10:15 +0000, Kuninori Morimoto wrote:
> commit d685aea5e0a8 ("ASoC: audio-graph-card2: fix off by one in
> graph_parse_node_multi_nm()") uses ">=" instead of ">" for index check,
> but it was wrong. The nm_idx will be increment at end of loop,
> thus, ">" is correct.
> 
> 	while (1) {
> 		...
> =>		if (*nm_idx > nm_max)
> 			break;
> 		...
> 		(*nm_idx)++;
> 	}
> 
> [...]

Applied to

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

Thanks!

[1/1] ASoC: audio-graph-card2: fix index check on graph_parse_node_multi_nm()
      commit: 301bda18ac735eaaad5823dbdd067b3b2728c780

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
diff mbox series

Patch

diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index 9c94677f681a..62606e20be9a 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -556,7 +556,7 @@  static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link,
 		struct device_node *mcodec_port;
 		int codec_idx;
 
-		if (*nm_idx >= nm_max)
+		if (*nm_idx > nm_max)
 			break;
 
 		mcpu_ep_n = of_get_next_child(mcpu_port, mcpu_ep_n);