Skip to contentSkip to conversation

gpio-amd8111: add release_region on ioport_map failure

PATCH In review [email protected] 2 participants 2 messages Jan 19, 2015 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio-amd8111: add release_region on ioport_map failure

From: Varka Bhadram <[email protected]>

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.

---
 drivers/gpio/gpio-amd8111.c |    1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-amd8111.c +1 -0
index 2c4d9ab..d00d819 100644
@@ -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;
 	}
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 9 lines · On Mon, Jan 19, 2015 at 9:05 AM, <[email protected]> wrote:

From: Varka Bhadram <[email protected]>

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.

Patch applied.

Yours,
Linus Walleij