Skip to content

Commit

Permalink
gpio: mpc8xxx: Fix a resources leak in the error handling path of 'mp…
Browse files Browse the repository at this point in the history
…c8xxx_probe()'

[ Upstream commit 555bda4 ]

Commit 698b8ee ("gpio/mpc8xxx: change irq handler from chained to normal")
has introduced a new 'goto err;' at the very end of the function, but has
not updated the error handling path accordingly.

Add the now missing 'irq_domain_remove()' call which balances a previous
'irq_domain_create_linear() call.

Fixes: 698b8ee ("gpio/mpc8xxx: change irq handler from chained to normal")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
tititiou36 authored and gregkh committed Sep 22, 2021
1 parent c2b5296 commit f869561
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpio/gpio-mpc8xxx.c
Expand Up @@ -406,6 +406,8 @@ static int mpc8xxx_probe(struct platform_device *pdev)

return 0;
err:
if (mpc8xxx_gc->irq)
irq_domain_remove(mpc8xxx_gc->irq);
iounmap(mpc8xxx_gc->regs);
return ret;
}
Expand Down

0 comments on commit f869561

Please sign in to comment.