From: Peter Ujfalusi Subject: [PATCH] ASoC: davinci-mcasp: off-by-one in davinci_mcasp_hw_rule_format() Date: Thu, 1 Sep 2016 10:05:12 +0300 Message-ID: <20160901070512.21410-1-peter.ujfalusi@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by alsa0.perex.cz (Postfix) with ESMTP id E45632666E1 for ; Thu, 1 Sep 2016 09:05:17 +0200 (CEST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: broonie@kernel.org, lgirdwood@gmail.com Cc: alsa-devel@alsa-project.org, jsarha@ti.com List-Id: alsa-devel@alsa-project.org The SNDRV_PCM_FORMAT_LAST is valid, we should not skip it. Signed-off-by: Peter Ujfalusi --- sound/soc/davinci/davinci-mcasp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index e10cfda21d89..31b4eac87aa2 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -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; -- 2.9.3