mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org, Ben Dooks <ben-linux@fluff.org>
Subject: Re: [PATCH] gpio: pca953x: fix error handling path in probe() call
Date: Wed, 30 Mar 2011 21:28:28 -0600	[thread overview]
Message-ID: <20110331032828.GA19333@ponder.secretlab.ca> (raw)
In-Reply-To: <1301523526-27799-1-git-send-email-broonie@opensource.wolfsonmicro.com>

On Thu, Mar 31, 2011 at 07:18:46AM +0900, Mark Brown wrote:
> From: Ben Dooks <ben-linux@fluff.org>
> 
> If the device fails to respond, then the error path tries to remove an
> interrupt that never got registered, which causes an backtrace from the
> interrupt handling code.
> 
> Fix this by ensuring that the cleanup path has two labels and use the
> correct path as needed.
> 
> fixes the following error:
> 
> WARNING: at kernel/irq/manage.c:908 __free_irq+0x80/0x160()
> Trying to free already-free IRQ 0
> 
> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Applied, thanks.

g.

> ---
>  drivers/gpio/pca953x.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
> index 583e925..7630ab7 100644
> --- a/drivers/gpio/pca953x.c
> +++ b/drivers/gpio/pca953x.c
> @@ -558,7 +558,7 @@ static int __devinit pca953x_probe(struct i2c_client *client,
>  
>  	ret = gpiochip_add(&chip->gpio_chip);
>  	if (ret)
> -		goto out_failed;
> +		goto out_failed_irq;
>  
>  	if (pdata->setup) {
>  		ret = pdata->setup(client, chip->gpio_chip.base,
> @@ -570,8 +570,9 @@ static int __devinit pca953x_probe(struct i2c_client *client,
>  	i2c_set_clientdata(client, chip);
>  	return 0;
>  
> -out_failed:
> +out_failed_irq:
>  	pca953x_irq_teardown(chip);
> +out_failed:
>  	kfree(chip->dyn_pdata);
>  	kfree(chip);
>  	return ret;
> -- 
> 1.7.4.1
> 

      reply	other threads:[~2011-03-31  3:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30 22:18 Mark Brown
2011-03-31  3:28 ` Grant Likely [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=20110331032828.GA19333@ponder.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=ben-linux@fluff.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®