diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2024-01-12 07:10:15 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-01-12 15:13:53 +0100 |
commit | 301bda18ac735eaaad5823dbdd067b3b2728c780 (patch) | |
tree | fd02152123ed2536349a65bf5b6c1196f0cca419 /sound/soc/generic | |
parent | ASoC: SOF: icp3-dtrace: Revert "Fix wrong kfree() usage" (diff) | |
download | linux-301bda18ac735eaaad5823dbdd067b3b2728c780.tar.xz linux-301bda18ac735eaaad5823dbdd067b3b2728c780.zip |
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>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/audio-graph-card2.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |