From: Purna Chandra Mandal <purna.mandal@microchip.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Mark Brown <broonie@kernel.org>, <linux-spi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [patch] spi: pic32-sqi: silence array overflow warning
Date: Fri, 22 Apr 2016 15:28:13 +0530 [thread overview]
Message-ID: <5719F5B5.2030101@microchip.com> (raw)
In-Reply-To: <20160422095524.GB11398@mwanda>
On 04/22/2016 03:25 PM, Dan Carpenter wrote:
> We read one element beyond the end of the array when we access
> "rdesc[i + 1]" so it causes a static checker warning. It's harmless
> because we write over it again on the next line. But let's just silence
> the warning.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/spi/spi-pic32-sqi.c b/drivers/spi/spi-pic32-sqi.c
> index b215347..74b9e68 100644
> --- a/drivers/spi/spi-pic32-sqi.c
> +++ b/drivers/spi/spi-pic32-sqi.c
> @@ -537,7 +537,7 @@ static int ring_desc_ring_alloc(struct pic32_sqi *sqi)
> }
>
> /* Prepare BD: chain to next BD(s) */
> - for (i = 0, rdesc = sqi->ring; i < PESQI_BD_COUNT; i++)
> + for (i = 0, rdesc = sqi->ring; i < PESQI_BD_COUNT - 1; i++)
> bd[i].bd_nextp = rdesc[i + 1].bd_dma;
> bd[PESQI_BD_COUNT - 1].bd_nextp = 0;
>
Reviewed-by: Purna Chandra Mandal <purna.mandal@microchip.com>
next prev parent reply other threads:[~2016-04-22 9:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 9:55 [patch] spi: pic32-sqi: silence array overflow warning Dan Carpenter
2016-04-22 9:58 ` Purna Chandra Mandal [this message]
2016-04-22 15:27 ` Applied "spi: pic32-sqi: silence array overflow warning" to the spi tree Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5719F5B5.2030101@microchip.com \
--to=purna.mandal@microchip.com \
--cc=broonie@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).