summaryrefslogtreecommitdiff
path: root/sound/i2c/other/pt2258.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/i2c/other/pt2258.c')
-rw-r--r--sound/i2c/other/pt2258.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/i2c/other/pt2258.c b/sound/i2c/other/pt2258.c
index 00c83d8..797d3a6 100644
--- a/sound/i2c/other/pt2258.c
+++ b/sound/i2c/other/pt2258.c
@@ -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;