diff options
Diffstat (limited to 'sound/core/oss/mixer_oss.c')
-rw-r--r-- | sound/core/oss/mixer_oss.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index 581aa2c60e6..4690b8b5681 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c | |||
@@ -257,8 +257,10 @@ static int snd_mixer_oss_get_volume(struct snd_mixer_oss_file *fmixer, int slot) | |||
257 | result = pslot->get_volume(fmixer, pslot, &left, &right); | 257 | result = pslot->get_volume(fmixer, pslot, &left, &right); |
258 | if (!pslot->stereo) | 258 | if (!pslot->stereo) |
259 | right = left; | 259 | right = left; |
260 | snd_assert(left >= 0 && left <= 100, return -EIO); | 260 | if (snd_BUG_ON(left < 0 || left > 100)) |
261 | snd_assert(right >= 0 && right <= 100, return -EIO); | 261 | return -EIO; |
262 | if (snd_BUG_ON(right < 0 || right > 100)) | ||
263 | return -EIO; | ||
262 | if (result >= 0) { | 264 | if (result >= 0) { |
263 | pslot->volume[0] = left; | 265 | pslot->volume[0] = left; |
264 | pslot->volume[1] = right; | 266 | pslot->volume[1] = right; |
@@ -298,7 +300,8 @@ static int snd_mixer_oss_ioctl1(struct snd_mixer_oss_file *fmixer, unsigned int | |||
298 | int __user *p = argp; | 300 | int __user *p = argp; |
299 | int tmp; | 301 | int tmp; |
300 | 302 | ||
301 | snd_assert(fmixer != NULL, return -ENXIO); | 303 | if (snd_BUG_ON(!fmixer)) |
304 | return -ENXIO; | ||
302 | if (((cmd >> 8) & 0xff) == 'M') { | 305 | if (((cmd >> 8) & 0xff) == 'M') { |
303 | switch (cmd) { | 306 | switch (cmd) { |
304 | case SOUND_MIXER_INFO: | 307 | case SOUND_MIXER_INFO: |
@@ -368,7 +371,8 @@ int snd_mixer_oss_ioctl_card(struct snd_card *card, unsigned int cmd, unsigned l | |||
368 | { | 371 | { |
369 | struct snd_mixer_oss_file fmixer; | 372 | struct snd_mixer_oss_file fmixer; |
370 | 373 | ||
371 | snd_assert(card != NULL, return -ENXIO); | 374 | if (snd_BUG_ON(!card)) |
375 | return -ENXIO; | ||
372 | if (card->mixer_oss == NULL) | 376 | if (card->mixer_oss == NULL) |
373 | return -ENXIO; | 377 | return -ENXIO; |
374 | memset(&fmixer, 0, sizeof(fmixer)); | 378 | memset(&fmixer, 0, sizeof(fmixer)); |
@@ -1284,9 +1288,11 @@ static int snd_mixer_oss_free1(void *private) | |||
1284 | struct snd_card *card; | 1288 | struct snd_card *card; |
1285 | int idx; | 1289 | int idx; |
1286 | 1290 | ||
1287 | snd_assert(mixer != NULL, return -ENXIO); | 1291 | if (!mixer) |
1292 | return 0; | ||
1288 | card = mixer->card; | 1293 | card = mixer->card; |
1289 | snd_assert(mixer == card->mixer_oss, return -ENXIO); | 1294 | if (snd_BUG_ON(mixer != card->mixer_oss)) |
1295 | return -ENXIO; | ||
1290 | card->mixer_oss = NULL; | 1296 | card->mixer_oss = NULL; |
1291 | for (idx = 0; idx < SNDRV_OSS_MAX_MIXERS; idx++) { | 1297 | for (idx = 0; idx < SNDRV_OSS_MAX_MIXERS; idx++) { |
1292 | struct snd_mixer_oss_slot *chn = &mixer->slots[idx]; | 1298 | struct snd_mixer_oss_slot *chn = &mixer->slots[idx]; |