diff mbox series

ASoC: codecs: wsa-macro: fix uninitialized stack variables with name prefix

Message ID 20231003155422.801160-1-krzysztof.kozlowski@linaro.org
State Accepted
Commit 72151ad0cba8a07df90130ff62c979520d71f23b
Headers show
Series ASoC: codecs: wsa-macro: fix uninitialized stack variables with name prefix | expand

Commit Message

Krzysztof Kozlowski Oct. 3, 2023, 3:54 p.m. UTC
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: 2c4066e5d428 ("ASoC: codecs: lpass-wsa-macro: add dapm widgets and route")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

This is a fix only for uninitialized values case.  The fix for including
name prefixes will be sent separate, because I think it is not a stable
material.  Happy to combine patches if needed.
---
 sound/soc/codecs/lpass-wsa-macro.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Mark Brown Oct. 9, 2023, 4:18 p.m. UTC | #1
On Tue, 03 Oct 2023 17:54:22 +0200, Krzysztof Kozlowski wrote:
> 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.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: codecs: wsa-macro: fix uninitialized stack variables with name prefix
      commit: 72151ad0cba8a07df90130ff62c979520d71f23b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index ec6859ec0d38..ea6e3fa7e9e1 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -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) {