From: Dan Carpenter <dan.carpenter@oracle.com>
To: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Zidan Wang <zidan.wang@freescale.com>,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Krzysztof Kozlowski <k.kozlowski@samsung.com>,
patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org,
kernel-janitors@vger.kernel.org
Subject: [patch] ASoC: wm8960: harmless underflow in wm8960_put_deemph()
Date: Tue, 13 Oct 2015 07:09:38 +0000 [thread overview]
Message-ID: <20151013070938.GE31537@mwanda> (raw)
In-Reply-To: <20151013070919.GD31537@mwanda>
Valid values of "deemph" are zero and one, but we accidentally allow
negative values as well. It's harmless but we may as well fix it.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index e3b7d0c..dc47c2f 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -201,7 +201,7 @@ static int wm8960_put_deemph(struct snd_kcontrol *kcontrol,
{
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
- int deemph = ucontrol->value.integer.value[0];
+ unsigned int deemph = ucontrol->value.integer.value[0];
if (deemph > 1)
return -EINVAL;
next prev parent reply other threads:[~2015-10-13 7:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 7:09 [patch] ASoC: wm8960: harmless underflow in wm8960_put_deemph() Dan Carpenter
2015-10-13 7:09 ` Dan Carpenter [this message]
2015-10-22 12:56 ` Mark Brown
2015-10-13 12:28 ` Charles Keepax
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151013070938.GE31537@mwanda \
--to=dan.carpenter@oracle.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=k.kozlowski@samsung.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=zidan.wang@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox