From: Srinivas Kandagatla Date: Tue, 22 Feb 2022 18:32:04 +0000 (+0000) Subject: ASoC: codecs: rx-macro: fix accessing compander for aux X-Git-Tag: v6.6.17~6759^2~146^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42c709c4e1ce4c136891530646c9abd5dff3524f;p=platform%2Fkernel%2Flinux-rpi.git ASoC: codecs: rx-macro: fix accessing compander for aux AUX interpolator does not have compander, so check before accessing compander data for this. Without this checkan array of out bounds access will be made in comp_enabled[] array. Fixes: 4f692926f562 ("ASoC: codecs: lpass-rx-macro: add dapm widgets and route") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220222183212.11580-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c index 6ffe88345de5..1ac0bc1c86b3 100644 --- a/sound/soc/codecs/lpass-rx-macro.c +++ b/sound/soc/codecs/lpass-rx-macro.c @@ -2039,6 +2039,10 @@ static int rx_macro_load_compander_coeff(struct snd_soc_component *component, int i; int hph_pwr_mode; + /* AUX does not have compander */ + if (comp == INTERP_AUX) + return 0; + if (!rx->comp_enabled[comp]) return 0;