ASoC: audio-graph-card2: fix index check on graph_parse_node_multi_nm()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 12 Jan 2024 06:10:15 +0000 (06:10 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 12 Jan 2024 14:13:53 +0000 (14:13 +0000)
commit301bda18ac735eaaad5823dbdd067b3b2728c780
treefd02152123ed2536349a65bf5b6c1196f0cca419
parent813c2f2925ee9c10dc4acd5aa7410cd3357e8da8
ASoC: audio-graph-card2: fix index check on graph_parse_node_multi_nm()

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>
Link: https://msgid.link/r/87o7drdqux.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/generic/audio-graph-card2.c