linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [bisected] NULL pointer dereference in acpi_gpiochip_add (on modprobe ssb)
Date: Tue, 25 Mar 2014 09:05:23 +0100	[thread overview]
Message-ID: <20140325080523.GD25669@kria> (raw)
In-Reply-To: <20140325072530.GP19349@intel.com>

2014-03-25, 09:25:30 +0200, Mika Westerberg wrote:
> On Mon, Mar 24, 2014 at 07:31:11PM +0100, Sabrina Dubroca wrote:
> > > Actually gpiolib seems to handle ->dev as optional. Can you try this patch
> > > instead? Thanks.
> > > 
> > > diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> > > index bf0f8b476696..642b2bf3360e 100644
> > > --- a/drivers/gpio/gpiolib-acpi.c
> > > +++ b/drivers/gpio/gpiolib-acpi.c
> > > @@ -501,6 +501,9 @@ void acpi_gpiochip_add(struct gpio_chip *chip)
> > >  	acpi_handle handle;
> > >  	acpi_status status;
> > >  
> > > +	if (!chip || !chip->dev)
> > > +		return;
> > > +
> > >  	handle = ACPI_HANDLE(chip->dev);
> > >  	if (!handle)
> > >  		return;
> > > @@ -531,6 +534,9 @@ void acpi_gpiochip_remove(struct gpio_chip *chip)
> > >  	acpi_handle handle;
> > >  	acpi_status status;
> > >  
> > > +	if (!chip || !chip->dev)
> > > +		return;
> > > +
> > >  	handle = ACPI_HANDLE(chip->dev);
> > >  	if (!handle)
> > >  		return;
> > 
> > Thanks, this patch solves the problem.
> 
> Great thanks for testing. Can I add your tested-by to the patch?
> 
> I'll submit a formal patch for this next week as I'm currently on vacation.

Sure:

Tested-by: Sabrina Dubroca <sd@queasysnail.net>


Thanks again,

-- 
Sabrina

      reply	other threads:[~2014-03-25  8:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-24 15:49 [bisected] NULL pointer dereference in acpi_gpiochip_add (on modprobe ssb) Sabrina Dubroca
2014-03-24 17:48 ` Arend van Spriel
2014-03-24 18:00 ` Mika Westerberg
2014-03-24 18:11   ` Mika Westerberg
2014-03-24 18:31     ` Sabrina Dubroca
2014-03-25  7:25       ` Mika Westerberg
2014-03-25  8:05         ` Sabrina Dubroca [this message]

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=20140325080523.GD25669@kria \
    --to=sd@queasysnail.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).