Unverified Commit d685aea5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown
Browse files

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: e2de6808 ("ASoC: audio-graph-card2: add CPU:Codec = N:M support")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Acked-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/1032216f-902f-48f9-aa49-9d5ece8e87f2@moroto.mountain


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8527ecc6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);