From 3b892467786410f26dffc2c7bccd3ea445604037 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 15 Nov 2007 16:17:24 +0100 Subject: [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 Signed-off-by: Jaroslav Kysela --- sound/i2c/other/pt2258.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/i2c') diff --git a/sound/i2c/other/pt2258.c b/sound/i2c/other/pt2258.c index 00c83d8b32b1..987d2c9a7a64 100644 --- a/sound/i2c/other/pt2258.c +++ b/sound/i2c/other/pt2258.c @@ -113,6 +113,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; -- cgit v1.2.1