]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ASoC: codecs: wcd934x: add a sanity check in set channel map
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tue, 9 Mar 2021 14:21:29 +0000 (14:21 +0000)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:11 +0000 (15:42 -0500)
commit932d110912db4c8f7d2c64d79de9182209c0a663
tree558ac71fc0352d1ff131c54a04e50aa6c739b08a
parent3db1d208d6d9a7520b54ff9a4beb376e1f8f3724
ASoC: codecs: wcd934x: add a sanity check in set channel map

BugLink: https://bugs.launchpad.net/bugs/1921712
commit 3bb4852d598f0275ed5996a059df55be7318ac2f upstream.

set channel map can be passed with a channel maps, however if
the number of channels that are passed are more than the actual
supported channels then we would be accessing array out of bounds.

So add a sanity check to validate these numbers!

Fixes: a61f3b4f476e ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec")
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210309142129.14182-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
sound/soc/codecs/wcd934x.c