]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: qcom: sdm845: Fix array out of range on rx slim channels
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tue, 9 Mar 2021 14:21:28 +0000 (14:21 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 10 Mar 2021 12:51:10 +0000 (12:51 +0000)
WCD934x has only 13 RX SLIM ports however we are setting it as 16
in set_channel_map, this will lead to array out of bounds error!

Orignally caught by enabling USBAN array out of bounds check:

Fixes: 5caf64c633a3 ("ASoC: qcom: sdm845: add support to DB845c and Lenovo Yoga")
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-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/sdm845.c

index 1e2c2d0902ea9b37a746606320a79051e35a6a58..153e9b2de0b53719a6037e984631f50b01f54970 100644 (file)
@@ -27,7 +27,7 @@
 #define SPK_TDM_RX_MASK         0x03
 #define NUM_TDM_SLOTS           8
 #define SLIM_MAX_TX_PORTS 16
-#define SLIM_MAX_RX_PORTS 16
+#define SLIM_MAX_RX_PORTS 13
 #define WCD934X_DEFAULT_MCLK_RATE      9600000
 
 struct sdm845_snd_data {