]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: codecs: wcd938x: fix incorrect used of portid
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Wed, 26 Jan 2022 11:35:46 +0000 (11:35 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 26 Jan 2022 13:31:37 +0000 (13:31 +0000)
commit17d67db87178ffe5bd95621cde775d967c695322
treedd09ed741961c1c80880bd683acc840da13e9211
parent9994f972368697b544f21a2bf3929a4026e81abb
ASoC: codecs: wcd938x: fix incorrect used of portid

Mixer controls have the channel id in mixer->reg, which is not same
as port id. port id should be derived from chan_info array.
So fix this. Without this, its possible that we could corrupt
struct wcd938x_sdw_priv by accessing port_map array out of range
with channel id instead of port id.

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