ASoC: qcom: sdm845: Fix array out of bounds access
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tue, 9 Mar 2021 14:21:27 +0000 (14:21 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 10 Mar 2021 12:51:09 +0000 (12:51 +0000)
commit1c668e1c0a0f74472469cd514f40c9012b324c31
treeaa5159666d0e38769ecb6819fe695bce856b2856
parent7c2a783c05b5821c54e686518d518f179372b8a8
ASoC: qcom: sdm845: Fix array out of bounds access

Static analysis Coverity had detected a potential array out-of-bounds
write issue due to the fact that MAX AFE port Id was set to 16 instead
of using AFE_PORT_MAX macro.

Fix this by properly using AFE_PORT_MAX macro.

Fixes: 1b93a8843147 ("ASoC: qcom: sdm845: handle soundwire stream")
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210309142129.14182-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/sdm845.c