From: David Binderman <dcb314@hotmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "jason@lakedaemon.net" <jason@lakedaemon.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: linux-4.1-rc7/drivers/irqchip/irq-renesas-intc-irqpin.c:418: array index used before limits check ?
Date: Mon, 8 Jun 2015 16:40:46 +0000 [thread overview]
Message-ID: <DUB128-W403BFD8BDDC8C67AAC8029CBF0@phx.gbl> (raw)
In-Reply-To: <alpine.DEB.2.11.1506081523510.4133@nanos>
Hello there Thomas,
----------------------------------------
>> I can't think of a situation where, if an array index needs checking, then
>> it should be checked *after* use.
>
> It does not check the array index. Read the complete code:
>
> for (k = 0; k < INTC_IRQPIN_REG_NR; k++) {
> io[k] = platform_get_resource(pdev, IORESOURCE_MEM, k);
> if (!io[k] && k < INTC_IRQPIN_REG_NR_MANDATORY) {
>
> The array bound is INTC_IRQPIN_REG_NR and the check about which that
> tool complains has nothing to do with array bounds. Completely valid
> code.
After a deeper look at the code, agreed. False positive by the tool.
I also checked the rest of the /irqchip/ directory for other messages by
the tool and couldn't see anything else suspicious.
Regards
David Binderman
prev parent reply other threads:[~2015-06-08 16:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-08 11:05 David Binderman
2015-06-08 13:10 ` Thomas Gleixner
2015-06-08 13:16 ` David Binderman
2015-06-08 13:26 ` Thomas Gleixner
2015-06-08 16:40 ` David Binderman [this message]
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=DUB128-W403BFD8BDDC8C67AAC8029CBF0@phx.gbl \
--to=dcb314@hotmail.com \
--cc=jason@lakedaemon.net \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®