aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers/vx/vx_pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/drivers/vx/vx_pcm.c')
-rw-r--r--sound/drivers/vx/vx_pcm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
index fdbf86571b1f..27de574c08f7 100644
--- a/sound/drivers/vx/vx_pcm.c
+++ b/sound/drivers/vx/vx_pcm.c
@@ -587,7 +587,8 @@ static int vx_pcm_playback_open(struct snd_pcm_substream *subs)
587 return -EBUSY; 587 return -EBUSY;
588 588
589 audio = subs->pcm->device * 2; 589 audio = subs->pcm->device * 2;
590 snd_assert(audio < chip->audio_outs, return -EINVAL); 590 if (snd_BUG_ON(audio >= chip->audio_outs))
591 return -EINVAL;
591 592
592 /* playback pipe may have been already allocated for monitoring */ 593 /* playback pipe may have been already allocated for monitoring */
593 pipe = chip->playback_pipes[audio]; 594 pipe = chip->playback_pipes[audio];
@@ -996,7 +997,8 @@ static int vx_pcm_capture_open(struct snd_pcm_substream *subs)
996 return -EBUSY; 997 return -EBUSY;
997 998
998 audio = subs->pcm->device * 2; 999 audio = subs->pcm->device * 2;
999 snd_assert(audio < chip->audio_ins, return -EINVAL); 1000 if (snd_BUG_ON(audio >= chip->audio_ins))
1001 return -EINVAL;
1000 err = vx_alloc_pipe(chip, 1, audio, 2, &pipe); 1002 err = vx_alloc_pipe(chip, 1, audio, 2, &pipe);
1001 if (err < 0) 1003 if (err < 0)
1002 return err; 1004 return err;
@@ -1214,7 +1216,8 @@ void vx_pcm_update_intr(struct vx_core *chip, unsigned int events)
1214 } 1216 }
1215 if (capture) 1217 if (capture)
1216 continue; 1218 continue;
1217 snd_assert(p >= 0 && (unsigned int)p < chip->audio_outs,); 1219 if (snd_BUG_ON(p < 0 || p >= chip->audio_outs))
1220 continue;
1218 pipe = chip->playback_pipes[p]; 1221 pipe = chip->playback_pipes[p];
1219 if (pipe && pipe->substream) { 1222 if (pipe && pipe->substream) {
1220 vx_pcm_playback_update(chip, pipe->substream, pipe); 1223 vx_pcm_playback_update(chip, pipe->substream, pipe);