aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/opti9xx
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-11-15 10:17:24 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:29:25 -0500
commit3b892467786410f26dffc2c7bccd3ea445604037 (patch)
tree4a70f86b1545e9be95d987fc248cac3cebbbd9a8 /sound/isa/opti9xx
parent498ade1a133dffd0f3ee90952737045d56e6689a (diff)
[ALSA] Check value range in ctl callbacks
Check the value ranges in ctl put callbacks properly (in the rest drivers). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/isa/opti9xx')
-rw-r--r--sound/isa/opti9xx/miro.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c
index d295936611f8..c2baf4cfb958 100644
--- a/sound/isa/opti9xx/miro.c
+++ b/sound/isa/opti9xx/miro.c
@@ -483,6 +483,10 @@ static int snd_miro_put_double(struct snd_kcontrol *kcontrol,
483 483
484 /* equalizer elements */ 484 /* equalizer elements */
485 485
486 if (left < -0x7f || left > 0x7f ||
487 right < -0x7f || right > 0x7f)
488 return -EINVAL;
489
486 if (left_old > 0x80) 490 if (left_old > 0x80)
487 left_old = 0x80 - left_old; 491 left_old = 0x80 - left_old;
488 if (right_old > 0x80) 492 if (right_old > 0x80)
@@ -520,6 +524,10 @@ static int snd_miro_put_double(struct snd_kcontrol *kcontrol,
520 524
521 /* non-equalizer elements */ 525 /* non-equalizer elements */
522 526
527 if (left < 0 || left > 0x20 ||
528 right < 0 || right > 0x20)
529 return -EINVAL;
530
523 left_old = 0x20 - left_old; 531 left_old = 0x20 - left_old;
524 right_old = 0x20 - right_old; 532 right_old = 0x20 - right_old;
525 533