aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/gpio.c
diff options
context:
space:
mode:
authorEvgeny Kuznetsov <ext-eugeny.kuznetsov@nokia.com>2010-12-07 19:25:40 -0500
committerTony Lindgren <tony@atomide.com>2010-12-07 19:25:40 -0500
commitb1cc4c55c69efed3ebbb2a13e4c77a2a1a4a6bc9 (patch)
tree5aff7ab2977693735d0830f2cfe48e3fa944d969 /arch/arm/plat-omap/gpio.c
parentbe40f7a3d7b53c1a44e11b376b4a395d6b91f58d (diff)
omap: Ptr "isr_reg" tracked as NULL was dereferenced
Value of "isr_reg" pointer is depend on configuration and GPIO method. Potentially it may have NULL value and it is dereferenced later in code. Warning and exit from function are added in this case. Signed-off-by: Evgeny Kuznetsov <EXT-Eugeny.Kuznetsov@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/gpio.c')
-rw-r--r--arch/arm/plat-omap/gpio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index c05c653d1674..e0e2fa725269 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1318,6 +1318,10 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1318 if (bank->method == METHOD_GPIO_44XX) 1318 if (bank->method == METHOD_GPIO_44XX)
1319 isr_reg = bank->base + OMAP4_GPIO_IRQSTATUS0; 1319 isr_reg = bank->base + OMAP4_GPIO_IRQSTATUS0;
1320#endif 1320#endif
1321
1322 if (WARN_ON(!isr_reg))
1323 goto exit;
1324
1321 while(1) { 1325 while(1) {
1322 u32 isr_saved, level_mask = 0; 1326 u32 isr_saved, level_mask = 0;
1323 u32 enabled; 1327 u32 enabled;
@@ -1377,6 +1381,7 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1377 configured, we must unmask the bank interrupt only after 1381 configured, we must unmask the bank interrupt only after
1378 handler(s) are executed in order to avoid spurious bank 1382 handler(s) are executed in order to avoid spurious bank
1379 interrupt */ 1383 interrupt */
1384exit:
1380 if (!unmasked) 1385 if (!unmasked)
1381 desc->chip->unmask(irq); 1386 desc->chip->unmask(irq);
1382 1387