summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>2025-09-09 13:19:42 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-15 12:00:21 +0200
commitabcd537aae3b84c6d10ad147e99a204bcb56b234 (patch)
treeaacdd46c7bd9329caf3d4395b283c89ba76e68ba /sound
parent2be09d893b9c273e8b2d5a3ddb45146027283cb0 (diff)
downloadlinux-abcd537aae3b84c6d10ad147e99a204bcb56b234.tar.gz
linux-abcd537aae3b84c6d10ad147e99a204bcb56b234.tar.bz2
linux-abcd537aae3b84c6d10ad147e99a204bcb56b234.zip
ASoC: codecs: wcd937x: set the comp soundwire port correctly
commit 66a940b1bf48a7095162688332d725ba160154eb upstream. For some reason we endup with setting soundwire port for HPHL_COMP and HPHR_COMP as zero, this can potentially result in a memory corruption due to accessing and setting -1 th element of port_map array. Fixes: 82be8c62a38c ("ASoC: codecs: wcd937x: add basic controls") Cc: Stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Reviewed-by: Alexey Klimov <alexey.klimov@linaro.org> Link: https://patch.msgid.link/20250909121954.225833-2-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wcd937x.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/wcd937x.c b/sound/soc/codecs/wcd937x.c
index 1df827a084ca..17ddd91eac5f 100644
--- a/sound/soc/codecs/wcd937x.c
+++ b/sound/soc/codecs/wcd937x.c
@@ -2039,9 +2039,9 @@ static const struct snd_kcontrol_new wcd937x_snd_controls[] = {
SOC_ENUM_EXT("RX HPH Mode", rx_hph_mode_mux_enum,
wcd937x_rx_hph_mode_get, wcd937x_rx_hph_mode_put),
- SOC_SINGLE_EXT("HPHL_COMP Switch", SND_SOC_NOPM, 0, 1, 0,
+ SOC_SINGLE_EXT("HPHL_COMP Switch", WCD937X_COMP_L, 0, 1, 0,
wcd937x_get_compander, wcd937x_set_compander),
- SOC_SINGLE_EXT("HPHR_COMP Switch", SND_SOC_NOPM, 1, 1, 0,
+ SOC_SINGLE_EXT("HPHR_COMP Switch", WCD937X_COMP_R, 1, 1, 0,
wcd937x_get_compander, wcd937x_set_compander),
SOC_SINGLE_TLV("HPHL Volume", WCD937X_HPH_L_EN, 0, 20, 1, line_gain),