projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c2a783
)
ASoC: qcom: sdm845: Fix array out of bounds access
author
Srinivas Kandagatla
<srinivas.kandagatla@linaro.org>
Tue, 9 Mar 2021 14:21:27 +0000
(14:21 +0000)
committer
Mark Brown
<broonie@kernel.org>
Wed, 10 Mar 2021 12:51:09 +0000
(12:51 +0000)
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
patch
|
blob
|
blame
|
history
diff --git
a/sound/soc/qcom/sdm845.c
b/sound/soc/qcom/sdm845.c
index 6c2760e27ea6fdbab1651e9f1ccbdc07887c73d7..1e2c2d0902ea9b37a746606320a79051e35a6a58 100644
(file)
--- a/
sound/soc/qcom/sdm845.c
+++ b/
sound/soc/qcom/sdm845.c
@@
-33,12
+33,12
@@
struct sdm845_snd_data {
struct snd_soc_jack jack;
bool jack_setup;
- bool stream_prepared[
SLIM_MAX_RX_PORTS
];
+ bool stream_prepared[
AFE_PORT_MAX
];
struct snd_soc_card *card;
uint32_t pri_mi2s_clk_count;
uint32_t sec_mi2s_clk_count;
uint32_t quat_tdm_clk_count;
- struct sdw_stream_runtime *sruntime[
SLIM_MAX_RX_PORTS
];
+ struct sdw_stream_runtime *sruntime[
AFE_PORT_MAX
];
};
static unsigned int tdm_slot_offset[8] = {0, 4, 8, 12, 16, 20, 24, 28};