summaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-06-23 11:58:06 +0200
committerTakashi Iwai <tiwai@suse.de>2008-06-23 12:06:23 +0200
commit3e14b50dd4a3178f4f635267a2706b5d4f8c61ee (patch)
tree3d16b9fbd8903a084b1e174dcb4f68aed94337eb /sound/isa
parent44e051773da465f8c92127914bc784770e0e2a28 (diff)
downloadop-kernel-dev-3e14b50dd4a3178f4f635267a2706b5d4f8c61ee.zip
op-kernel-dev-3e14b50dd4a3178f4f635267a2706b5d4f8c61ee.tar.gz
ALSA: sb - Fix wrong assertions
snd_assert() in save_mixer() and restore_mixer() in sb_mixer.c is just wrong. The debug code wasn't tested at all, obviously... Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/sb/sb_mixer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c
index 91d1422..73d4572 100644
--- a/sound/isa/sb/sb_mixer.c
+++ b/sound/isa/sb/sb_mixer.c
@@ -925,7 +925,7 @@ static unsigned char als4000_saved_regs[] = {
static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
{
unsigned char *val = chip->saved_regs;
- snd_assert(num_regs > ARRAY_SIZE(chip->saved_regs), return);
+ snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return);
for (; num_regs; num_regs--)
*val++ = snd_sbmixer_read(chip, *regs++);
}
@@ -933,7 +933,7 @@ static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
{
unsigned char *val = chip->saved_regs;
- snd_assert(num_regs > ARRAY_SIZE(chip->saved_regs), return);
+ snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return);
for (; num_regs; num_regs--)
snd_sbmixer_write(chip, *regs++, *val++);
}
OpenPOWER on IntegriCloud