From 513858585202171d7603024ea65659335df4c8e9 Mon Sep 17 00:00:00 2001 From: Varka Bhadram Date: Mon, 19 Jan 2015 13:35:48 +0530 Subject: [PATCH] gpio-amd8111: add release_region on ioport_map failure Commit ffe4770b9b3483f74 ("gpio-amd8111: check ioport_map return value") adds the error check on ioport_map(). It doesnt release the requested region. On failure this patch release the region that has requested before. Signed-off-by: Varka Bhadram Reported-by: Alexandre Courbot Signed-off-by: Linus Walleij --- drivers/gpio/gpio-amd8111.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-amd8111.c b/drivers/gpio/gpio-amd8111.c index 2c4d9ab34acc..d00d81928fe8 100644 --- a/drivers/gpio/gpio-amd8111.c +++ b/drivers/gpio/gpio-amd8111.c @@ -215,6 +215,7 @@ found: gp.pm = ioport_map(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE); if (!gp.pm) { dev_err(&pdev->dev, "Couldn't map io port into io memory\n"); + release_region(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE); err = -ENOMEM; goto out; } -- 2.39.5