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

ASoC: wm8903: harmless underflow in wm8903_put_deemph()

Valid values for "deemph" are zero and one, but we accidentally allow
negative values as well. It's harmless, but static checkers complain
and 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
4d0197a5 6ff33f39

+1 -1
+1 -1
sound/soc/codecs/wm8903.c
··· 452 452 { 453 453 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); 454 454 struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); 455 - int deemph = ucontrol->value.integer.value[0]; 455 + unsigned int deemph = ucontrol->value.integer.value[0]; 456 456 int ret = 0; 457 457 458 458 if (deemph > 1)