Skip to contentSkip to conversation

ASoC: max9867: signedness bug in max9867_dai_hw_params()

PATCH In review Dan Carpenter 2 participants 2 messages Feb 25, 2016

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

PATCH 1/2 ASoC: max9867: signedness bug in max9867_dai_hw_params()

"value" needs to be signed for the error handling to work.

Fixes 805d132dcbbd ('ASoC: Add max9867 codec driver')
sound/soc/codecs/max9867.c +2 -1
index ab7a94d..4fb6fc7 100755
@@ -180,7 +180,8 @@ static int max9867_dai_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_codec *codec = dai->codec;
 	struct max9867_priv *max9867 = snd_soc_codec_get_drvdata(codec);
-	unsigned int ni_h, ni_l, value;
+	unsigned int ni_h, ni_l;
+	int value;
 
 	value = get_ni_value(max9867->sysclk, params_rate(params));
 	if (value < 0)
#1 lore raw

2016-02-25 15:48 GMT+08:00 Dan Carpenter <[email protected]>:

Quoted 10 lines

"value" needs to be signed for the error handling to work.

Fixes 805d132dcbbd ('ASoC: Add max9867 codec driver')
sound/soc/codecs/max9867.c +0 -0
index ab7a94d..4fb6fc7 100755

sound/soc/codecs/max9867.c static int max9867_dai_hw_params(struct snd_pcm_substream *substream, · line 184

Quoted 6 lines
sound/soc/codecs/max9867.c +2 -1
@@ -180,7 +180,8 @@ static int max9867_dai_hw_params(struct snd_pcm_substream *substream,
 {
        struct snd_soc_codec *codec = dai->codec;
        struct max9867_priv *max9867 = snd_soc_codec_get_drvdata(codec);
-       unsigned int ni_h, ni_l, value;
+       unsigned int ni_h, ni_l;
+       int value;

Already fixed by
http://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/commit/?h=topic/max9867&id=127a9cbb5860a7cf15f4d4703ab0454e4603e8ac