]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: codecs: wc938x: fix accessing array out of bounds for enum type
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tue, 22 Feb 2022 18:32:09 +0000 (18:32 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 23 Feb 2022 02:04:06 +0000 (02:04 +0000)
commitd1b08b7cedc20ba819d704b419ae143362636f20
treefe204f24d9f30f2dc9767e3cbd20e52eb8794b82
parentd69d9b49cfdd3ee0f260946ee66eb17a26a676a2
ASoC: codecs: wc938x: fix accessing array out of bounds for enum type

Accessing enums using integer would result in array out of bounds access
on platforms like aarch64 where sizeof(long) is 8 compared to enum size
which is 4 bytes.

Fix this by using enumerated items instead of integers.

Fixes: 251e100d9cde ("ASoC: codecs: wcd938x: add basic controls")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220222183212.11580-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wcd938x.c