From patchwork Wed Oct 13 10:04:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Kuznetsov X-Patchwork-Id: 250151 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9DAB053030402 for ; Wed, 13 Oct 2010 10:11:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752867Ab0JMKKO (ORCPT ); Wed, 13 Oct 2010 06:10:14 -0400 Received: from smtp.nokia.com ([192.100.122.233]:37621 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752809Ab0JMKKN (ORCPT ); Wed, 13 Oct 2010 06:10:13 -0400 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o9DA8g5Y018164; Wed, 13 Oct 2010 13:09:03 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 13 Oct 2010 13:08:54 +0300 Received: from xesebe101.nee.nokia.com ([147.243.42.11]) by vaebh104.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 13 Oct 2010 13:08:39 +0300 Received: from xesefe101.nee.nokia.com ([147.243.42.13]) by xesebe101.nee.nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 13 Oct 2010 13:08:39 +0300 Received: from localhost.localdomain ([10.127.9.148]) by xesefe101.nee.nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 13 Oct 2010 13:08:38 +0300 From: Evgeny Kuznetsov To: tony@atomide.com Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, balbi@ti.com, linux@arm.linux.org.uk, khilman@deeprootsystems.com, akpm@linux-foundation.org, charu@ti.com, tero.kristo@nokia.com, ext-eugeny.kuznetsov@nokia.com Subject: [PATCHv2 1/1] omap: Ptr "isr_reg" tracked as NULL was dereferenced Date: Wed, 13 Oct 2010 14:04:50 +0400 Message-Id: <7bb69801f49283c3bde78aa008c15308ac8a5fbf.1286961160.git.EXT-Eugeny.Kuznetsov@nokia.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: References: In-Reply-To: References: X-OriginalArrivalTime: 13 Oct 2010 10:08:39.0051 (UTC) FILETIME=[9B35B5B0:01CB6ABE] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 13 Oct 2010 10:11:02 +0000 (UTC) diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index c05c653..d04913c 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c @@ -1318,6 +1318,23 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc) if (bank->method == METHOD_GPIO_44XX) isr_reg = bank->base + OMAP4_GPIO_IRQSTATUS0; #endif + +#if !defined(CONFIG_ARCH_OMAP1) && \ + !defined(CONFIG_ARCH_OMAP15XX) && \ + !defined(CONFIG_ARCH_OMAP16XX) && \ + !defined(CONFIG_ARCH_OMAP730) && \ + !defined(CONFIG_ARCH_OMAP850) && \ + !defined(CONFIG_ARCH_OMAP2) && \ + !defined(CONFIG_ARCH_OMAP3) && \ + !defined(CONFIG_ARCH_OMAP4) + +#error "Incorrect arch configuration" + +#endif + + if (WARN_ON(!isr_reg)) + goto exit; + while(1) { u32 isr_saved, level_mask = 0; u32 enabled; @@ -1377,6 +1394,7 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc) configured, we must unmask the bank interrupt only after handler(s) are executed in order to avoid spurious bank interrupt */ +exit: if (!unmasked) desc->chip->unmask(irq);