mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: <linux-kernel@vger.kernel.org>, <mingo@redhat.com>,
	<hpa@zytor.com>, <tglx@linutronix.de>
Cc: <linux-tip-commits@vger.kernel.org>
Subject: Re: [tip:irq/core] genirq: Warn if enable_irq is called before irq is set up
Date: Fri, 22 Oct 2010 15:43:22 +0200	[thread overview]
Message-ID: <2ae2295020fc2c103ca624e08e43c849@radon2.swed.at> (raw)
In-Reply-To: <tip-658fc358f9954083ea55abf82ca77a18f82412d7@git.kernel.org>

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);


       reply	other threads:[~2010-10-22 13:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tip-658fc358f9954083ea55abf82ca77a18f82412d7@git.kernel.org>
2010-10-22 13:43 ` Richard Weinberger [this message]
2010-10-22 14:09   ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ae2295020fc2c103ca624e08e43c849@radon2.swed.at \
    --to=richard@nod.at \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®