Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [patch] ALSA: usb-audio: harmless underflow in snd_audigy2nx_led_put()
@ 2015-09-28 10:06 Dan Carpenter
  2015-09-28 12:33 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-09-28 10:06 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: Takashi Iwai, Chris J Arges, Damien Zammit, Dmitry M. Fedin,
	alsa-devel, kernel-janitors

We want to verify that "value" is either zero or one, so we test if it
is greater than one.  Unfortunately, this is a signed int so it could
also be negative.  I think this is harmless but it introduces a static
checker warning.  Let's make "value" unsigned.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 337c317..4602a78 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -340,7 +340,7 @@ static int snd_audigy2nx_led_put(struct snd_kcontrol *kcontrol,
 	struct usb_mixer_elem_list *list = snd_kcontrol_chip(kcontrol);
 	struct usb_mixer_interface *mixer = list->mixer;
 	int index = kcontrol->private_value & 0xff;
-	int value = ucontrol->value.integer.value[0];
+	unsigned int value = ucontrol->value.integer.value[0];
 	int old_value = kcontrol->private_value >> 8;
 	int err;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-28 12:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-28 10:06 [patch] ALSA: usb-audio: harmless underflow in snd_audigy2nx_led_put() Dan Carpenter
2015-09-28 12:33 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox