Skip to content

Commit

Permalink
ASoC: codecs: wsa-macro: fix uninitialized stack variables with name …
Browse files Browse the repository at this point in the history
…prefix

commit 72151ad upstream.

Driver compares widget name in wsa_macro_spk_boost_event() widget event
callback, however it does not handle component's name prefix.  This
leads to using uninitialized stack variables as registers and register
values.  Handle gracefully such case.

Fixes: 2c4066e ("ASoC: codecs: lpass-wsa-macro: add dapm widgets and route")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231003155422.801160-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
krzk authored and gregkh committed Nov 28, 2023
1 parent 479a120 commit e166cc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/soc/codecs/lpass-wsa-macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,9 @@ static int wsa_macro_spk_boost_event(struct snd_soc_dapm_widget *w,
boost_path_cfg1 = CDC_WSA_RX1_RX_PATH_CFG1;
reg = CDC_WSA_RX1_RX_PATH_CTL;
reg_mix = CDC_WSA_RX1_RX_PATH_MIX_CTL;
} else {
dev_warn(component->dev, "Incorrect widget name in the driver\n");
return -EINVAL;
}

switch (event) {
Expand Down

0 comments on commit e166cc2

Please sign in to comment.