From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756864Ab0JVNn0 (ORCPT ); Fri, 22 Oct 2010 09:43:26 -0400 Received: from a.ns.miles-group.at ([95.130.255.143]:55192 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755283Ab0JVNnZ (ORCPT ); Fri, 22 Oct 2010 09:43:25 -0400 /m: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Fri, 22 Oct 2010 15:43:22 +0200 From: Richard Weinberger To: , , , Cc: Subject: Re: [tip:irq/core] genirq: Warn if enable_irq is called before irq is set up In-Reply-To: References: Message-ID: <2ae2295020fc2c103ca624e08e43c849@radon2.swed.at> User-Agent: RoundCube Webmail Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Oct 2010 13:09:49 GMT, tip-bot for Thomas Gleixner wrote: > Commit-ID: 658fc358f9954083ea55abf82ca77a18f82412d7 > Gitweb: > http://git.kernel.org/tip/658fc358f9954083ea55abf82ca77a18f82412d7 > Author: Thomas Gleixner > AuthorDate: Fri, 22 Oct 2010 14:47:57 +0200 > Committer: Thomas Gleixner > 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 > Cc: Richard Weinberger > --- > 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);