ASoC: audio-graph-card2: fix off by one in graph_parse_node_multi_nm()

The > comparison should be >= to avoid writing one element beyond the end
of the dai_link->ch_maps[] array.  The dai_link->ch_maps[] array is
allocated in graph_parse_node_multi() and it has "nm_max" elements.

Fixes: e2de6808df ("ASoC: audio-graph-card2: add CPU:Codec = N:M support")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Kuninori Morimoto <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
Dan Carpenter
2023-12-07 14:00:03 +00:00
committed by Mark Brown
parent 8527ecc6cf
commit d685aea5e0
+1 -1
View File
@@ -557,7 +557,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);