Skip to content

Commit 8e847a4

Browse files
committed
ASoC: mt6358: Validate Wake on Voice 2 writes
Currently the Wake on Voice 2 control accepts and stores any value written but it reports that only 0 and 1 are valid values. Reject any out of range values written by userspace. Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230224-asoc-mt6358-quick-fixes-v1-2-747d9186be4b@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3425dda commit 8e847a4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sound/soc/codecs/mt6358.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,9 @@ static int mt6358_put_wov(struct snd_kcontrol *kcontrol,
560560
struct mt6358_priv *priv = snd_soc_component_get_drvdata(c);
561561
int enabled = ucontrol->value.integer.value[0];
562562

563+
if (enabled < 0 || enabled > 1)
564+
return -EINVAL;
565+
563566
if (priv->wov_enabled != enabled) {
564567
if (enabled)
565568
mt6358_enable_wov_phase2(priv);

0 commit comments

Comments
 (0)