Skip to content

Commit

Permalink
ARM: davinci: Check for NULL return from irq_alloc_generic_chip
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Todd Poynor authored and Sekhar Nori committed Jul 19, 2011
1 parent f299bb9 commit 33e1e5e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/arm/mach-davinci/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
struct irq_chip_type *ct;

gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_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_ack = irq_gc_ack;
ct->chip.irq_mask = irq_gc_mask_clr_bit;
Expand Down

0 comments on commit 33e1e5e

Please sign in to comment.