aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-alsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-alsa.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-alsa.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c
index 9929d20320b4..26194a0ce927 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -488,10 +488,12 @@ static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream,
488 period_size = params_period_bytes(hw_params); 488 period_size = params_period_bytes(hw_params);
489 periods = params_periods(hw_params); 489 periods = params_periods(hw_params);
490 490
491 snd_assert(period_size >= 0x100 && period_size <= 0x10000, 491 if (period_size < 0x100 || period_size > 0x10000)
492 return -EINVAL); 492 return -EINVAL;
493 snd_assert(periods >= 4, return -EINVAL); 493 if (periods < 4)
494 snd_assert(period_size * periods <= 1024 * 1024, return -EINVAL); 494 return -EINVAL;
495 if (period_size * periods > 1024 * 1024)
496 return -EINVAL;
495 497
496 dev = saa7134->dev; 498 dev = saa7134->dev;
497 499
@@ -942,7 +944,8 @@ static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip)
942 unsigned int idx; 944 unsigned int idx;
943 int err; 945 int err;
944 946
945 snd_assert(chip != NULL, return -EINVAL); 947 if (snd_BUG_ON(!chip))
948 return -EINVAL;
946 strcpy(card->mixername, "SAA7134 Mixer"); 949 strcpy(card->mixername, "SAA7134 Mixer");
947 950
948 for (idx = 0; idx < ARRAY_SIZE(snd_saa7134_controls); idx++) { 951 for (idx = 0; idx < ARRAY_SIZE(snd_saa7134_controls); idx++) {