From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759753Ab2ERWke (ORCPT ); Fri, 18 May 2012 18:40:34 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:46434 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755138Ab2ERWkc (ORCPT ); Fri, 18 May 2012 18:40:32 -0400 From: Grant Likely Subject: Re: [PATCH] gpio: mpc8xxx: Prevent NULL pointer deref in demux handler To: Thomas Gleixner , LKML Cc: Felix Radensky , Thomas Wucher , Kumar Gala In-Reply-To: References: Date: Fri, 18 May 2012 16:40:29 -0600 Message-Id: <20120518224029.321113E07C8@localhost> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 3 May 2012 12:22:06 +0200 (CEST), Thomas Gleixner wrote: > This time with the correct CC of the reporter :) Applied, thanks. g. > > --------------> > Subject: gpio: mpc8xxx: Prevent NULL pointer deref in demux handler > From: Thomas Gleixner > Date: Thu, 03 May 2012 11:58:09 +0200 > > commit cfadd838(powerpc/8xxx: Fix interrupt handling in MPC8xxx GPIO > driver) added an unconditional call of chip->irq_eoi() to the demux > handler. > > This leads to a NULL pointer derefernce on MPC512x platforms which use > this driver as well. > > Make it conditional. > > Reported-by: Thomas Wucher > Signed-off-by: Thomas Gleixner > Cc: Felix Radensky > Cc: Kumar Gala > Cc: Grant Likely > Cc: stable@vger.kernel.org > --- > drivers/gpio/gpio-mpc8xxx.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > Index: linux-2.6/drivers/gpio/gpio-mpc8xxx.c > =================================================================== > --- linux-2.6.orig/drivers/gpio/gpio-mpc8xxx.c > +++ linux-2.6/drivers/gpio/gpio-mpc8xxx.c > @@ -163,7 +163,8 @@ static void mpc8xxx_gpio_irq_cascade(uns > if (mask) > generic_handle_irq(irq_linear_revmap(mpc8xxx_gc->irq, > 32 - ffs(mask))); > - chip->irq_eoi(&desc->irq_data); > + if (chip->irq_eoi) > + chip->irq_eoi(&desc->irq_data); > } > > static void mpc8xxx_irq_unmask(struct irq_data *d) -- Grant Likely, B.Sc, P.Eng. Secret Lab Technologies, Ltd.