* [PATCH 2/4] ARM: orion: Check NULL return from irq_alloc_generic_chip
@ 2011-07-12 22:36 Todd Poynor
0 siblings, 0 replies; only message in thread
From: Todd Poynor @ 2011-07-12 22:36 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Todd Poynor <toddpoynor@google.com>
---
arch/arm/plat-orion/gpio.c | 7 +++++++
arch/arm/plat-orion/irq.c | 7 +++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 5b4fffa..ddc20d3 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -419,6 +419,13 @@ void __init orion_gpio_init(int gpio_base, int ngpio,
gc = irq_alloc_generic_chip("orion_gpio_irq", 2, secondary_irq_base,
ochip->base, handle_level_irq);
+
+ if (!gc) {
+ pr_err("%s: irq_alloc_generic_chip for IRQ %d failed\n",
+ __func__, secondary_irq_base);
+ return;
+ }
+
gc->private = ochip;
ct = gc->chip_types;
diff --git a/arch/arm/plat-orion/irq.c b/arch/arm/plat-orion/irq.c
index 2d5b9c1..41e6e82 100644
--- a/arch/arm/plat-orion/irq.c
+++ b/arch/arm/plat-orion/irq.c
@@ -26,6 +26,13 @@ void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
gc = irq_alloc_generic_chip("orion_irq", 1, irq_start, maskaddr,
handle_level_irq);
+
+ if (!gc) {
+ pr_err("%s: irq_alloc_generic_chip for IRQ %u failed\n",
+ __func__, irq_start);
+ return;
+ }
+
ct = gc->chip_types;
ct->chip.irq_mask = irq_gc_mask_clr_bit;
ct->chip.irq_unmask = irq_gc_mask_set_bit;
--
1.7.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-07-12 22:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-12 22:36 [PATCH 2/4] ARM: orion: Check NULL return from irq_alloc_generic_chip Todd Poynor
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.