diff options
author | Todd Poynor <toddpoynor@google.com> | 2011-07-17 01:39:35 -0400 |
---|---|---|
committer | Sekhar Nori <nsekhar@ti.com> | 2011-07-19 03:19:00 -0400 |
commit | 33e1e5e317b0fc78ac6588ec8aa40005bcddd7ce (patch) | |
tree | 001bb1f8b9a2072e3de8dc6ae54f82c8b3f6d4cc /arch | |
parent | f299bb9527abfa6ee45a5e26288b5e3a619f01d6 (diff) |
ARM: davinci: Check for NULL return from irq_alloc_generic_chip
Avoid NULL dereference of irq_alloc_generic_chip return in low
memory conditions.
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-davinci/irq.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/irq.c b/arch/arm/mach-davinci/irq.c index bfe68ec4e1a6..85e77fd9d56a 100644 --- a/arch/arm/mach-davinci/irq.c +++ b/arch/arm/mach-davinci/irq.c | |||
@@ -52,6 +52,12 @@ davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) | |||
52 | struct irq_chip_type *ct; | 52 | struct irq_chip_type *ct; |
53 | 53 | ||
54 | gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq); | 54 | gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq); |
55 | if (!gc) { | ||
56 | pr_err("%s: irq_alloc_generic_chip for IRQ %u failed\n", | ||
57 | __func__, irq_start); | ||
58 | return; | ||
59 | } | ||
60 | |||
55 | ct = gc->chip_types; | 61 | ct = gc->chip_types; |
56 | ct->chip.irq_ack = irq_gc_ack; | 62 | ct->chip.irq_ack = irq_gc_ack; |
57 | ct->chip.irq_mask = irq_gc_mask_clr_bit; | 63 | ct->chip.irq_mask = irq_gc_mask_clr_bit; |