aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/sb/sb_mixer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/sb/sb_mixer.c')
-rw-r--r--sound/isa/sb/sb_mixer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c
index 73d4572d136b..406a431af91e 100644
--- a/sound/isa/sb/sb_mixer.c
+++ b/sound/isa/sb/sb_mixer.c
@@ -792,7 +792,8 @@ int snd_sbmixer_new(struct snd_sb *chip)
792 struct snd_card *card; 792 struct snd_card *card;
793 int err; 793 int err;
794 794
795 snd_assert(chip != NULL && chip->card != NULL, return -EINVAL); 795 if (snd_BUG_ON(!chip || !chip->card))
796 return -EINVAL;
796 797
797 card = chip->card; 798 card = chip->card;
798 799
@@ -925,7 +926,8 @@ static unsigned char als4000_saved_regs[] = {
925static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) 926static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
926{ 927{
927 unsigned char *val = chip->saved_regs; 928 unsigned char *val = chip->saved_regs;
928 snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return); 929 if (snd_BUG_ON(num_regs > ARRAY_SIZE(chip->saved_regs)))
930 return;
929 for (; num_regs; num_regs--) 931 for (; num_regs; num_regs--)
930 *val++ = snd_sbmixer_read(chip, *regs++); 932 *val++ = snd_sbmixer_read(chip, *regs++);
931} 933}
@@ -933,7 +935,8 @@ static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
933static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) 935static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
934{ 936{
935 unsigned char *val = chip->saved_regs; 937 unsigned char *val = chip->saved_regs;
936 snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return); 938 if (snd_BUG_ON(num_regs > ARRAY_SIZE(chip->saved_regs)))
939 return;
937 for (; num_regs; num_regs--) 940 for (; num_regs; num_regs--)
938 snd_sbmixer_write(chip, *regs++, *val++); 941 snd_sbmixer_write(chip, *regs++, *val++);
939} 942}