mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [tip:irq/core] genirq: Warn if enable_irq is called before irq is set up
       [not found] <tip-658fc358f9954083ea55abf82ca77a18f82412d7@git.kernel.org>
@ 2010-10-22 13:43 ` Richard Weinberger
  2010-10-22 14:09   ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Weinberger @ 2010-10-22 13:43 UTC (permalink / raw)
  To: linux-kernel, mingo, hpa, tglx; +Cc: linux-tip-commits

On Fri, 22 Oct 2010 13:09:49 GMT, tip-bot for Thomas Gleixner
<tglx@linutronix.de> wrote:
> Commit-ID:  658fc358f9954083ea55abf82ca77a18f82412d7
> Gitweb:    
> http://git.kernel.org/tip/658fc358f9954083ea55abf82ca77a18f82412d7
> Author:     Thomas Gleixner <tglx@linutronix.de>
> AuthorDate: Fri, 22 Oct 2010 14:47:57 +0200
> Committer:  Thomas Gleixner <tglx@linutronix.de>
> CommitDate: Fri, 22 Oct 2010 15:05:35 +0200
> 
> genirq: Warn if enable_irq is called before irq is set up
> 
> The recent changes in the genirq core unearthed a bug in arch/um which
> called enable_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 <tglx@linutronix.de>
> Cc: Richard Weinberger <richard@nod.at>
> ---
>  kernel/irq/manage.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index 644e8d5..2806023 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -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

> +		return;
> +
>  	chip_bus_lock(desc);
>  	raw_spin_lock_irqsave(&desc->lock, flags);
>  	__enable_irq(desc, irq, false);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [tip:irq/core] genirq: Warn if enable_irq is called before irq is set up
  2010-10-22 13:43 ` [tip:irq/core] genirq: Warn if enable_irq is called before irq is set up Richard Weinberger
@ 2010-10-22 14:09   ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2010-10-22 14:09 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-kernel, mingo, hpa, linux-tip-commits

On Fri, 22 Oct 2010, Richard Weinberger wrote:
> On Fri, 22 Oct 2010 13:09:49 GMT, tip-bot for Thomas Gleixner
> > @@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-22 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <tip-658fc358f9954083ea55abf82ca77a18f82412d7@git.kernel.org>
2010-10-22 13:43 ` [tip:irq/core] genirq: Warn if enable_irq is called before irq is set up Richard Weinberger
2010-10-22 14:09   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®