genirq: Warn if enable_irq is called before irq is set up
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 27 lines · tip-bot for Thomas Gleixner
Commit-ID:
658fc358f9954083ea55abf82ca77a18f82412d7Gitweb:
http://git.kernel.org/tip/658fc358f9954083ea55abf82ca77a18f82412d7Author: Thomas Gleixner <[email protected]> AuthorDate: Fri, 22 Oct 2010 14:47:57 +0200 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 22 Oct 2010 15:05:35 +0200genirq: Warn if
enable_irqis called before irq is set upThe recent changes in the genirq core unearthed a bug in
arch/umwhich calledenable_irq()before the interrupt was set up.Warn and return instead of crashing the machine with a NULL pointer dereference.
Signed-off-by Thomas Gleixner <[email protected]>Cc Richard Weinberger <[email protected]>--- kernel/irq/manage.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)kernel/irq/manage.c +0
-0
kernel/irq/manage.c void enable_irq(unsigned int irq) · line 328
Quoted 5 lines
kernel/irq/manage.c +2
-0@@ -324,6 +324,10 @@ void enable_irq(unsigned int irq)if (!desc)return ; +if (WARN (!desc->irq_data.chip || !desc->irq_data.chip->irq_enable, +"KERN_ERR enable_irq before setup/request_irq: irq %u\n" , irq))
Here is a little typo. The double quote should be after KERN_ERR.
Thanks,
//richard
Quoted 5 lines
kernel/irq/manage.c +2
-0+return ; +chip_bus_lock (desc);raw_spin_lock_irqsave (&desc->lock, flags);__enable_irq (desc, irq, false);
Quoted 9 lines · Richard Weinberger
On Fri, 22 Oct 2010 13:09:49 GMT, tip-bot for Thomas Gleixner
Review void enable_irq(unsigned int irq) · line 328
Quoted 6 lines
(quoted diff) +2
-0@@ -324,6 +324,10 @@ void enable_irq(unsigned int irq) if (!desc) return; + if (WARN(!desc->irq_data.chip || !desc->irq_data.chip->irq_enable, + "KERN_ERR enable_irq before setup/request_irq: irq %u\n", irq))Here is a little typo. The double quote should be after
KERN_ERR.
Crap, yes. It still compiles :)
Thanks,
tglx