diff options
| author | Mark Brown <[email protected]> | 2023-02-26 12:47:57 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2023-02-28 13:58:41 +0000 |
| commit | 8e847a43c28fca0aaa11fba8f91da7dfd9d6936f (patch) | |
| tree | b78fe87482a5899a58f6c74bef91d4d487125759 | |
| parent | ASoC: mt6358: Fix event generation for wake on voice stage 2 switch (diff) | |
| download | kernel-8e847a43c28fca0aaa11fba8f91da7dfd9d6936f.tar.gz kernel-8e847a43c28fca0aaa11fba8f91da7dfd9d6936f.zip | |
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
| -rw-r--r-- | sound/soc/codecs/mt6358.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/mt6358.c b/sound/soc/codecs/mt6358.c index 9004377461f7..89d0dcb2635b 100644 --- a/sound/soc/codecs/mt6358.c +++ b/sound/soc/codecs/mt6358.c @@ -560,6 +560,9 @@ static int mt6358_put_wov(struct snd_kcontrol *kcontrol, struct mt6358_priv *priv = snd_soc_component_get_drvdata(c); int enabled = ucontrol->value.integer.value[0]; + if (enabled < 0 || enabled > 1) + return -EINVAL; + if (priv->wov_enabled != enabled) { if (enabled) mt6358_enable_wov_phase2(priv); |
