aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-amd8111.c
diff options
context:
space:
mode:
authorVarka Bhadram <varkab@cdac.in>2015-01-19 03:05:48 -0500
committerLinus Walleij <linus.walleij@linaro.org>2015-01-19 03:48:45 -0500
commit513858585202171d7603024ea65659335df4c8e9 (patch)
tree715361c324ecbd3bce2a738f5d08ae1e3f41d3d5 /drivers/gpio/gpio-amd8111.c
parenta0b66e3f5a2522d1a5cf1127bc8cba0834b0fbf6 (diff)
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 <varkab@cdac.in> Reported-by: Alexandre Courbot <gnurou@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-amd8111.c')
-rw-r--r--drivers/gpio/gpio-amd8111.c1
1 files changed, 1 insertions, 0 deletions
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:
215 gp.pm = ioport_map(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE); 215 gp.pm = ioport_map(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE);
216 if (!gp.pm) { 216 if (!gp.pm) {
217 dev_err(&pdev->dev, "Couldn't map io port into io memory\n"); 217 dev_err(&pdev->dev, "Couldn't map io port into io memory\n");
218 release_region(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE);
218 err = -ENOMEM; 219 err = -ENOMEM;
219 goto out; 220 goto out;
220 } 221 }