summaryrefslogtreecommitdiffstats
path: root/sound/core/vmaster.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/vmaster.c')
-rw-r--r--sound/core/vmaster.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/core/vmaster.c b/sound/core/vmaster.c
index 04a57f7be6ea..c657659b236c 100644
--- a/sound/core/vmaster.c
+++ b/sound/core/vmaster.c
@@ -199,6 +199,12 @@ static int follower_put(struct snd_kcontrol *kcontrol,
if (err < 0)
return err;
for (ch = 0; ch < follower->info.count; ch++) {
+ if (ucontrol->value.integer.value[ch] < follower->info.min_val ||
+ ucontrol->value.integer.value[ch] > follower->info.max_val)
+ return -EINVAL;
+ }
+
+ for (ch = 0; ch < follower->info.count; ch++) {
if (follower->vals[ch] != ucontrol->value.integer.value[ch]) {
changed = 1;
follower->vals[ch] = ucontrol->value.integer.value[ch];
@@ -365,6 +371,8 @@ static int master_put(struct snd_kcontrol *kcontrol,
new_val = ucontrol->value.integer.value[0];
if (new_val == old_val)
return 0;
+ if (new_val < master->info.min_val || new_val > master->info.max_val)
+ return -EINVAL;
err = sync_followers(master, old_val, new_val);
if (err < 0)