diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-11-15 07:16:02 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:24 -0500 |
commit | 7e39e2273a9b8182ed1b21af5444e29843fc06ca (patch) | |
tree | f7c1c1d32e536fd6466b4fcc3f9df10e51f97e87 /sound | |
parent | 44d0a879951a90a4eb463fb1d3b91942f97f36ca (diff) |
[ALSA] emu10k1 - Check value ranges in ctl callbacks
Check value ranges in ctl callbacks properly. This fixes the unexpected
crash due to wrong value assignment.
Also, remove invalid comments in the last patch.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/emu10k1/emumixer.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 4b85a6b273cd..ccacd7b890e8 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c | |||
@@ -1089,7 +1089,6 @@ static int snd_emu10k1_send_volume_put(struct snd_kcontrol *kcontrol, | |||
1089 | { | 1089 | { |
1090 | unsigned long flags; | 1090 | unsigned long flags; |
1091 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | 1091 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); |
1092 | /* FIXME: Check limits */ | ||
1093 | struct snd_emu10k1_pcm_mixer *mix = | 1092 | struct snd_emu10k1_pcm_mixer *mix = |
1094 | &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; | 1093 | &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; |
1095 | int change = 0, idx, val; | 1094 | int change = 0, idx, val; |
@@ -1142,7 +1141,6 @@ static int snd_emu10k1_attn_get(struct snd_kcontrol *kcontrol, | |||
1142 | struct snd_ctl_elem_value *ucontrol) | 1141 | struct snd_ctl_elem_value *ucontrol) |
1143 | { | 1142 | { |
1144 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | 1143 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); |
1145 | /* FIXME: Check limits */ | ||
1146 | struct snd_emu10k1_pcm_mixer *mix = | 1144 | struct snd_emu10k1_pcm_mixer *mix = |
1147 | &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; | 1145 | &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; |
1148 | unsigned long flags; | 1146 | unsigned long flags; |
@@ -1160,7 +1158,6 @@ static int snd_emu10k1_attn_put(struct snd_kcontrol *kcontrol, | |||
1160 | { | 1158 | { |
1161 | unsigned long flags; | 1159 | unsigned long flags; |
1162 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | 1160 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); |
1163 | /* FIXME: Check limits */ | ||
1164 | struct snd_emu10k1_pcm_mixer *mix = | 1161 | struct snd_emu10k1_pcm_mixer *mix = |
1165 | &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; | 1162 | &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; |
1166 | int change = 0, idx, val; | 1163 | int change = 0, idx, val; |
@@ -1213,7 +1210,6 @@ static int snd_emu10k1_efx_send_routing_get(struct snd_kcontrol *kcontrol, | |||
1213 | { | 1210 | { |
1214 | unsigned long flags; | 1211 | unsigned long flags; |
1215 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | 1212 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); |
1216 | /* FIXME: Check limits */ | ||
1217 | struct snd_emu10k1_pcm_mixer *mix = | 1213 | struct snd_emu10k1_pcm_mixer *mix = |
1218 | &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; | 1214 | &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; |
1219 | int idx; | 1215 | int idx; |
@@ -1233,7 +1229,6 @@ static int snd_emu10k1_efx_send_routing_put(struct snd_kcontrol *kcontrol, | |||
1233 | { | 1229 | { |
1234 | unsigned long flags; | 1230 | unsigned long flags; |
1235 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | 1231 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); |
1236 | /* FIXME: Check limits */ | ||
1237 | int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 1232 | int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
1238 | struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; | 1233 | struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; |
1239 | int change = 0, idx, val; | 1234 | int change = 0, idx, val; |
@@ -1285,7 +1280,6 @@ static int snd_emu10k1_efx_send_volume_get(struct snd_kcontrol *kcontrol, | |||
1285 | { | 1280 | { |
1286 | unsigned long flags; | 1281 | unsigned long flags; |
1287 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | 1282 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); |
1288 | /* FIXME: Check limits */ | ||
1289 | struct snd_emu10k1_pcm_mixer *mix = | 1283 | struct snd_emu10k1_pcm_mixer *mix = |
1290 | &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; | 1284 | &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; |
1291 | int idx; | 1285 | int idx; |
@@ -1303,7 +1297,6 @@ static int snd_emu10k1_efx_send_volume_put(struct snd_kcontrol *kcontrol, | |||
1303 | { | 1297 | { |
1304 | unsigned long flags; | 1298 | unsigned long flags; |
1305 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | 1299 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); |
1306 | /* FIXME: Check limits */ | ||
1307 | int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 1300 | int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
1308 | struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; | 1301 | struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; |
1309 | int change = 0, idx, val; | 1302 | int change = 0, idx, val; |
@@ -1352,7 +1345,6 @@ static int snd_emu10k1_efx_attn_get(struct snd_kcontrol *kcontrol, | |||
1352 | struct snd_ctl_elem_value *ucontrol) | 1345 | struct snd_ctl_elem_value *ucontrol) |
1353 | { | 1346 | { |
1354 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | 1347 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); |
1355 | /* FIXME: Check limits */ | ||
1356 | struct snd_emu10k1_pcm_mixer *mix = | 1348 | struct snd_emu10k1_pcm_mixer *mix = |
1357 | &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; | 1349 | &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; |
1358 | unsigned long flags; | 1350 | unsigned long flags; |
@@ -1368,7 +1360,6 @@ static int snd_emu10k1_efx_attn_put(struct snd_kcontrol *kcontrol, | |||
1368 | { | 1360 | { |
1369 | unsigned long flags; | 1361 | unsigned long flags; |
1370 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | 1362 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); |
1371 | /* FIXME: Check limits */ | ||
1372 | int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 1363 | int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
1373 | struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; | 1364 | struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; |
1374 | int change = 0, val; | 1365 | int change = 0, val; |