]> 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)
commit2feb580946c55dd5db41bfe2283b4e99c4efb99c
treedd09ed741961c1c80880bd683acc840da13e9211
parentc416eaba4ab00461acf5bc04910b909c18d4792a
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: b70c0cbe395a ("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