Skip to contentSkip to conversation

ARM: davinci: Check for NULL return from irq_alloc_generic_chip

PATCH Superseded Todd Poynor 3 participants 3 messages Jul 12, 2011 – Jul 14, 2011

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 ARM: davinci: Check for NULL return from irq_alloc_generic_chip

---
 arch/arm/mach-davinci/irq.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-davinci/irq.c +7 -0
index bfe68ec..ab7f688 100644
@@ -52,6 +52,13 @@ 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;
Signature · 1 line
1.7.3.1
#1 lore raw

PATCH 1/4 ARM: davinci: Check for NULL return from irq_alloc_generic_chip

Hello.

Quoted 10 lines · Todd Poynor
---
  arch/arm/mach-davinci/irq.c |    7 +++++++
  1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-davinci/irq.c +0 -0
index bfe68ec..ab7f688 100644

arch/arm/mach-davinci/irq.c davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) · line 55

Quoted 4 lines
arch/arm/mach-davinci/irq.c +1 -0
@@ -52,6 +52,13 @@ 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);
+

Remove this empty line please.

arch/arm/mach-davinci/irq.c davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) · line 64

Quoted 9 lines
arch/arm/mach-davinci/irq.c +6 -0
+	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;

WBR, Sergei

#2 lore raw

PATCH 1/4 ARM: davinci: Check for NULL return from irq_alloc_generic_chip

In reply to Todd Poynor

Hi Todd,

Quoted 1 line · Todd Poynor

Can you please include some patch description (even if it turns out to be a restatement of patch headline)?

Also, in general, including some background on how you discovered the issue and how it affected you can help determine the priority of the fix.

Thanks,
Sekhar

Quoted 26 lines
---
 arch/arm/mach-davinci/irq.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-davinci/irq.c +7 -0
index bfe68ec..ab7f688 100644
@@ -52,6 +52,13 @@ 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;
Signature · 1 line
1.7.3.1