From: Peter Ujfalusi Date: Thu, 1 Sep 2016 07:05:12 +0000 (+0300) Subject: ASoC: davinci-mcasp: off-by-one in davinci_mcasp_hw_rule_format() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=9be072a6f9187f087a8b7682b70b898ac5cb7d64;p=deliverable%2Flinux.git ASoC: davinci-mcasp: off-by-one in davinci_mcasp_hw_rule_format() The SNDRV_PCM_FORMAT_LAST is valid, we should not skip it. Signed-off-by: Peter Ujfalusi Signed-off-by: Mark Brown --- diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 05c2d33aa74d..3c5a9804d3f5 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -1218,7 +1218,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;