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

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: [email protected]
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
krzk authored and broonie committed Oct 9, 2023
1 parent 528a4a0 commit 72151ad
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 @@ -1685,6 +1685,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 72151ad

Please sign in to comment.