From: Pramod Gurav Date: Wed, 1 Oct 2014 10:03:00 +0000 (+0530) Subject: gpio: amd8111: unmap ioport on failure case X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8fb87deb95ce3a0fa320ebc9df19f6f928714861;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git gpio: amd8111: unmap ioport on failure case This change unmaps ioport when gpiochip_add fails Signed-off-by: Pramod Gurav Reviewed-by: Alexandre Courbot Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-amd8111.c b/drivers/gpio/gpio-amd8111.c index 3c09f1a6872a..d3d2d1099f64 100644 --- a/drivers/gpio/gpio-amd8111.c +++ b/drivers/gpio/gpio-amd8111.c @@ -223,6 +223,7 @@ found: if (err) { printk(KERN_ERR "GPIO registering failed (%d)\n", err); + ioport_unmap(gp.pm); release_region(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE); goto out; }