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)
commitcc587b7c8fbbe128f6bd0dad025a0caea5e6d164
treefe204f24d9f30f2dc9767e3cbd20e52eb8794b82
parent0ea5eff7c6063a8f124188424f8e4c6727f35051
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: e8ba1e05bdc0 ("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