Skip to content

Commit

Permalink
gpio/pca953x: fix error handling path in probe() call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Dooks authored and Grant Likely committed Mar 31, 2011
1 parent 0ce790e commit 272df50
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpio/pca953x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down

0 comments on commit 272df50

Please sign in to comment.