Skip to contentSkip to conversation

ASoC: davinci-mcasp: off-by-one in davinci_mcasp_hw_rule_format()

PATCH New Peter Ujfalusi 1 participant 1 message Sep 1, 2016

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

PATCH 1/1 ASoC: davinci-mcasp: off-by-one in davinci_mcasp_hw_rule_format()

The SNDRV_PCM_FORMAT_LAST is valid, we should not skip it.

---
 sound/soc/davinci/davinci-mcasp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/davinci/davinci-mcasp.c +1 -1
index e10cfda21d89..31b4eac87aa2 100644
@@ -1239,7 +1239,7 @@ static int davinci_mcasp_hw_rule_format(struct snd_pcm_hw_params *params,
 
 	snd_mask_none(&nfmt);
 
-	for (i = 0; i < SNDRV_PCM_FORMAT_LAST; i++) {
+	for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) {
 		if (snd_mask_test(fmt, i)) {
 			uint sbits = snd_pcm_format_width(i);
 			int ppm;
Signature · 1 line
2.9.3