Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: wm8955: harmless underflow in wm8955_put_deemph()

Valid values for "deemph" are zero and one, but we mistakenly allow
negative values as well. It's harmless but we may as well clean it up.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dan Carpenter and committed by
Mark Brown
3e2a71b2 6ff33f39

+1 -1
+1 -1
sound/soc/codecs/wm8955.c
··· 402 402 { 403 403 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); 404 404 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); 405 - int deemph = ucontrol->value.integer.value[0]; 405 + unsigned int deemph = ucontrol->value.integer.value[0]; 406 406 407 407 if (deemph > 1) 408 408 return -EINVAL;