diff options
author | Ben Dooks <ben-linux@fluff.org> | 2011-03-30 18:18:46 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-03-30 23:28:12 -0400 |
commit | 272df502bcd1fbb1b95facc92bd861d604be8871 (patch) | |
tree | 1216a5519f98c8021ebc1d5aac88d30926c64263 /drivers/gpio/pca953x.c | |
parent | 0ce790e7d736cedc563e1fb4e998babf5a4dbc3d (diff) |
gpio/pca953x: fix error handling path in probe() call
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>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/gpio/pca953x.c')
-rw-r--r-- | 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 583e92592073..7630ab7b9bec 100644 --- a/drivers/gpio/pca953x.c +++ b/drivers/gpio/pca953x.c | |||
@@ -558,7 +558,7 @@ static int __devinit pca953x_probe(struct i2c_client *client, | |||
558 | 558 | ||
559 | ret = gpiochip_add(&chip->gpio_chip); | 559 | ret = gpiochip_add(&chip->gpio_chip); |
560 | if (ret) | 560 | if (ret) |
561 | goto out_failed; | 561 | goto out_failed_irq; |
562 | 562 | ||
563 | if (pdata->setup) { | 563 | if (pdata->setup) { |
564 | ret = pdata->setup(client, chip->gpio_chip.base, | 564 | ret = pdata->setup(client, chip->gpio_chip.base, |
@@ -570,8 +570,9 @@ static int __devinit pca953x_probe(struct i2c_client *client, | |||
570 | i2c_set_clientdata(client, chip); | 570 | i2c_set_clientdata(client, chip); |
571 | return 0; | 571 | return 0; |
572 | 572 | ||
573 | out_failed: | 573 | out_failed_irq: |
574 | pca953x_irq_teardown(chip); | 574 | pca953x_irq_teardown(chip); |
575 | out_failed: | ||
575 | kfree(chip->dyn_pdata); | 576 | kfree(chip->dyn_pdata); |
576 | kfree(chip); | 577 | kfree(chip); |
577 | return ret; | 578 | return ret; |