Skip to contentSkip to conversation

ASoC: Keep index within stac9766_reg[]

PATCH New Roel Kluin 1 participant 1 message Jul 13, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 ASoC: Keep index within stac9766_reg[]

Keep index within stac9766_reg[]

---

sound/soc/codecs/stac9766.c +1 -1
index 8ad4b7b..11f467e 100644
@@ -149,7 +149,7 @@ static int stac9766_ac97_write(struct snd_soc_codec *codec, unsigned int reg,
 		stac9766_ac97_write(codec, AC97_INT_PAGING, 1);
 		return 0;
 	}
-	if (reg / 2 > ARRAY_SIZE(stac9766_reg))
+	if (reg / 2 >= ARRAY_SIZE(stac9766_reg))
 		return -EIO;
 
 	soc_ac97_ops.write(codec->ac97, reg, val);