gpio: amd8111: unmap ioport on failure case
authorPramod Gurav <pramod.gurav@smartplayin.com>
Wed, 1 Oct 2014 10:03:00 +0000 (15:33 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 27 Oct 2014 15:26:35 +0000 (16:26 +0100)
This change unmaps ioport when gpiochip_add fails

Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-amd8111.c

index 3c09f1a6872aa22dd0e4784082f838c58cd8ee8b..d3d2d1099f645b75ed39ab5a5ac110d66bad5691 100644 (file)
@@ -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;
        }