]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/i2c/other/pt2258.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke...
[karo-tx-linux.git] / sound / i2c / other / pt2258.c
index 00c83d8b32b11c1b195f886ff9b4e6ff2b31f2ca..797d3a6687ebf7557308fd5a1d14201a230e8dbe 100644 (file)
@@ -19,7 +19,6 @@
  *
  */      
 
-#include <sound/driver.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/tlv.h>
@@ -113,6 +112,8 @@ static int pt2258_stereo_volume_put(struct snd_kcontrol *kcontrol,
 
        val0 = 79 - ucontrol->value.integer.value[0];
        val1 = 79 - ucontrol->value.integer.value[1];
+       if (val0 < 0 || val0 > 79 || val1 < 0 || val1 > 79)
+               return -EINVAL;
        if (val0 == pt->volume[base] && val1 == pt->volume[base + 1])
                return 0;