Skip to contentSkip to conversation

ALSA: cs46xx - signedness bug in snd_cs46xx_codec_read()

PATCH Applied Dan Carpenter 2 participants 2 messages Aug 10, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: cs46xx - signedness bug in snd_cs46xx_codec_read()

This function returns its own error codes instead of normal negative error codes.

sound/pci/cs46xx/cs46xx_lib.c +1 -1
index f75f5ff..a71d1c1 100644
@@ -94,7 +94,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
 
 	if (snd_BUG_ON(codec_index != CS46XX_PRIMARY_CODEC_INDEX &&
 		       codec_index != CS46XX_SECONDARY_CODEC_INDEX))
-		return -EINVAL;
+		return 0xffff;
 
 	chip->active_ctrl(chip, 1);
 
Applied
#1 lore raw

At Fri, 10 Aug 2012 12:22:58 +0300,

Quoted 5 lines · Dan Carpenter

This function returns its own error codes instead of normal negative error codes.

Thanks, applied now.

Takashi

Quoted 15 lines
sound/pci/cs46xx/cs46xx_lib.c +1 -1
index f75f5ff..a71d1c1 100644
@@ -94,7 +94,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
 
 	if (snd_BUG_ON(codec_index != CS46XX_PRIMARY_CODEC_INDEX &&
 		       codec_index != CS46XX_SECONDARY_CODEC_INDEX))
-		return -EINVAL;
+		return 0xffff;
 
 	chip->active_ctrl(chip, 1);