diff mbox

[gpio] gpio-amd8111: add release_region on ioport_map failure

Message ID 1421654748-32141-1-git-send-email-varkabhadram@gmail.com
State New, archived
Headers show

Commit Message

Varka Bhadram Jan. 19, 2015, 8:05 a.m. UTC
From: Varka Bhadram <varkab@cdac.in>

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>
---
 drivers/gpio/gpio-amd8111.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Linus Walleij Jan. 19, 2015, 8:49 a.m. UTC | #1
On Mon, Jan 19, 2015 at 9:05 AM,  <varkabhadram@gmail.com> wrote:

> From: Varka Bhadram <varkab@cdac.in>
>
> 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>

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-amd8111.c b/drivers/gpio/gpio-amd8111.c
index 2c4d9ab..d00d819 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;
 	}