[<prev] [next>] [day] [month] [year] [list]
Message-ID: <88D294E28D20D84C9350E231A79B0E63017F07D53E@orsmsx506.amr.corp.intel.com>
Date: Wed, 30 Nov 2011 16:58:28 -0800
From: "Yang, Fei" <fei.yang@...el.com>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: Alan Cox <alan@...ux.intel.com>,
"Gross, Mark" <mark.gross@...el.com>,
"tglx@...utronix.de" <tglx@...utronix.de>
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@...el.com>
Acked-by: Alan Cox <alan@...ux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists