lkml.org 
[lkml]   [2011]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH] IRQ: Validate irq_ack function pointer before calling it
handle_edge_irq doesn't validate function pointer irq_ack
before calling it. We need to check the pointer for NULL or the
drivers have to implement irq_ack even an empty one. I think the
former is better in case driver doesn't really need irq_ack.

Signed-off-by: Fei Yang <fei.yang@intel.com>
Acked-by: Alan Cox <alan@linux.intel.com>
---
kernel/irq/chip.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index dc5114b..12f9550 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -448,7 +448,8 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
kstat_incr_irqs_this_cpu(irq, desc);

/* Start handling the irq */
- desc->irq_data.chip->irq_ack(&desc->irq_data);
+ if (desc->irq_data.chip->irq_ack)
+ desc->irq_data.chip->irq_ack(&desc->irq_data);

do {
if (unlikely(!desc->action)) {
--
1.7.0.4


\
 
 \ /
  Last update: 2011-12-01 02:01    [W:0.022 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site