]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
gpio: mpc8xxx: Fix a resources leak in the error handling path of 'mpc8xxx_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 20 Aug 2021 15:37:55 +0000 (17:37 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 31 Aug 2021 10:09:53 +0000 (12:09 +0200)
Commit 698b8eeaed72 ("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: 698b8eeaed72 ("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>
drivers/gpio/gpio-mpc8xxx.c

index 4b9157a69fca01cef1687418094a12a8a6b633e1..b5cbeca5e300587d1b78c94c784480a174a1f52f 100644 (file)
@@ -416,6 +416,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;
 }