Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33e1e5e3 authored by Todd Poynor's avatar Todd Poynor Committed by Sekhar Nori
Browse files

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: default avatarTodd Poynor <toddpoynor@google.com>
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent f299bb95
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;