aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Poeschel <poeschel@lemonage.de>2013-08-07 11:23:58 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-08-16 10:53:16 -0400
commit5b21533b767578f9a80f09082e3aae7429c331c3 (patch)
tree1853196b83a54f67f123ece40daf76226695fdf8
parentb3abebc777015a445a95548aafe2d3a4b116288e (diff)
gpio: adnp: Fix segfault if request_threaded_irq fails
In case request_threaded_irq inside adnp_irq_setup fails, the driver segfaults. This is because irq_domain_remove is called twice with the same pointer. First time in adnp_irq_setup and then a second time after leaving adnp_irq_setup in the error path of adnp_i2c_probe inside adnp_teardown. This fixes this by removing the call to irq_domain_remove from adnp_irq_setup. Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpio-adnp.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-adnp.c b/drivers/gpio/gpio-adnp.c
index e60567fc5073..c0f3fc44ab0e 100644
--- a/drivers/gpio/gpio-adnp.c
+++ b/drivers/gpio/gpio-adnp.c
@@ -490,15 +490,11 @@ static int adnp_irq_setup(struct adnp *adnp)
490 if (err != 0) { 490 if (err != 0) {
491 dev_err(chip->dev, "can't request IRQ#%d: %d\n", 491 dev_err(chip->dev, "can't request IRQ#%d: %d\n",
492 adnp->client->irq, err); 492 adnp->client->irq, err);
493 goto error; 493 return err;
494 } 494 }
495 495
496 chip->to_irq = adnp_gpio_to_irq; 496 chip->to_irq = adnp_gpio_to_irq;
497 return 0; 497 return 0;
498
499error:
500 irq_domain_remove(adnp->domain);
501 return err;
502} 498}
503 499
504static void adnp_irq_teardown(struct adnp *adnp) 500static void adnp_irq_teardown(struct adnp *adnp)