All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 1/1] omap: Ptr "isr_reg" tracked as NULL was dereferenced
@ 2010-11-08  8:38 ` Evgeny Kuznetsov
  0 siblings, 0 replies; 4+ messages in thread
From: Evgeny Kuznetsov @ 2010-11-08  8:38 UTC (permalink / raw)
  To: tony
  Cc: linux-omap, linux-kernel, linux-arm-kernel, linux, ext-eugeny.kuznetsov

From: Evgeny Kuznetsov <ext-eugeny.kuznetsov@nokia.com>

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>
---
 arch/arm/plat-omap/gpio.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index c05c653..e0e2fa7 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)
 	if (bank->method == METHOD_GPIO_44XX)
 		isr_reg = bank->base + OMAP4_GPIO_IRQSTATUS0;
 #endif
+
+	if (WARN_ON(!isr_reg))
+		goto exit;
+
 	while(1) {
 		u32 isr_saved, level_mask = 0;
 		u32 enabled;
@@ -1377,6 +1381,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);
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCHv3 1/1] omap: Ptr "isr_reg" tracked as NULL was dereferenced
@ 2010-11-08  8:38 ` Evgeny Kuznetsov
  0 siblings, 0 replies; 4+ messages in thread
From: Evgeny Kuznetsov @ 2010-11-08  8:38 UTC (permalink / raw)
  To: linux-arm-kernel

From: Evgeny Kuznetsov <ext-eugeny.kuznetsov@nokia.com>

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>
---
 arch/arm/plat-omap/gpio.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index c05c653..e0e2fa7 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)
 	if (bank->method == METHOD_GPIO_44XX)
 		isr_reg = bank->base + OMAP4_GPIO_IRQSTATUS0;
 #endif
+
+	if (WARN_ON(!isr_reg))
+		goto exit;
+
 	while(1) {
 		u32 isr_saved, level_mask = 0;
 		u32 enabled;
@@ -1377,6 +1381,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);
 
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCHv3 1/1] omap: Ptr "isr_reg" tracked as NULL was dereferenced
  2010-11-08  8:38 ` Evgeny Kuznetsov
@ 2010-11-16 21:39   ` Tony Lindgren
  -1 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2010-11-16 21:39 UTC (permalink / raw)
  To: Evgeny Kuznetsov; +Cc: linux-omap, linux-kernel, linux-arm-kernel, linux

* Evgeny Kuznetsov <EXT-Eugeny.Kuznetsov@nokia.com> [101108 00:35]:
> From: Evgeny Kuznetsov <ext-eugeny.kuznetsov@nokia.com>
> 
> 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.

Thanks, queueing this for 2.6.38 merge window.

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCHv3 1/1] omap: Ptr "isr_reg" tracked as NULL was dereferenced
@ 2010-11-16 21:39   ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2010-11-16 21:39 UTC (permalink / raw)
  To: linux-arm-kernel

* Evgeny Kuznetsov <EXT-Eugeny.Kuznetsov@nokia.com> [101108 00:35]:
> From: Evgeny Kuznetsov <ext-eugeny.kuznetsov@nokia.com>
> 
> 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.

Thanks, queueing this for 2.6.38 merge window.

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-16 21:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-08  8:38 [PATCHv3 1/1] omap: Ptr "isr_reg" tracked as NULL was dereferenced Evgeny Kuznetsov
2010-11-08  8:38 ` Evgeny Kuznetsov
2010-11-16 21:39 ` Tony Lindgren
2010-11-16 21:39   ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.