]> www.infradead.org Git - users/dwmw2/linux.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)
commitc5c1546a654f613e291a7c5d6f3660fc1eb6d0c7
treedd09ed741961c1c80880bd683acc840da13e9211
parent4cf28e9ae6e2e11a044be1bcbcfa1b0d8675fe4d
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: e8ba1e05bdc0 ("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