Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753331AbbFHQks (ORCPT ); Mon, 8 Jun 2015 12:40:48 -0400 Received: from dub004-omc2s10.hotmail.com ([157.55.1.149]:54654 "EHLO DUB004-OMC2S10.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753178AbbFHQkr convert rfc822-to-8bit (ORCPT ); Mon, 8 Jun 2015 12:40:47 -0400 X-TMN: [6WhBjZO6omEC7JIagn2p5z+mh3TuTiZK] X-Originating-Email: [dcb314@hotmail.com] Message-ID: From: David Binderman To: Thomas Gleixner CC: "jason@lakedaemon.net" , "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 Importance: Normal In-Reply-To: References: , , Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 X-OriginalArrivalTime: 08 Jun 2015 16:40:46.0803 (UTC) FILETIME=[DEAD0230:01D0A209] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1029 Lines: 30 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/