Skip to content

Commit

Permalink
gpio: gpio-altera: Remove gpiochip on probe failure.
Browse files Browse the repository at this point in the history
On failure to setup the irq altera_gpio_probe would return an error
but not go to cleanup. This resulted in kernel fault
"Unable to handle kernel paging request at virtual address xxxxxxxx"
later on in of_gpiochip_find_and_xlate.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Phil Reid authored and Linus Walleij committed Jan 27, 2016
1 parent 92e963f commit 73c13c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpio/gpio-altera.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ static int altera_gpio_probe(struct platform_device *pdev)
handle_simple_irq, IRQ_TYPE_NONE);

if (ret) {
dev_info(&pdev->dev, "could not add irqchip\n");
return ret;
dev_err(&pdev->dev, "could not add irqchip\n");
goto teardown;
}

gpiochip_set_chained_irqchip(&altera_gc->mmchip.gc,
Expand All @@ -326,6 +326,7 @@ static int altera_gpio_probe(struct platform_device *pdev)
skip_irq:
return 0;
teardown:
of_mm_gpiochip_remove(&altera_gc->mmchip);
pr_err("%s: registration failed with status %d\n",
node->full_name, ret);

Expand Down

0 comments on commit 73c13c8

Please sign in to comment.