[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DUB128-W403BFD8BDDC8C67AAC8029CBF0@phx.gbl>
Date: Mon, 8 Jun 2015 16:40:46 +0000
From: David Binderman <dcb314@...mail.com>
To: Thomas Gleixner <tglx@...utronix.de>
CC: "jason@...edaemon.net" <jason@...edaemon.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: linux-4.1-rc7/drivers/irqchip/irq-renesas-intc-irqpin.c:418:
array index used before limits check ?
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists