All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH gpio] gpio-amd8111: add release_region on ioport_map failure
@ 2015-01-19  8:05 varkabhadram
  2015-01-19  8:49 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: varkabhadram @ 2015-01-19  8:05 UTC (permalink / raw)
  To: linux-gpio; +Cc: linus.walleij, gnurou, Varka Bhadram

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(+)

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;
 	}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH gpio] gpio-amd8111: add release_region on ioport_map failure
  2015-01-19  8:05 [PATCH gpio] gpio-amd8111: add release_region on ioport_map failure varkabhadram
@ 2015-01-19  8:49 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2015-01-19  8:49 UTC (permalink / raw)
  To: Varka Bhadram; +Cc: linux-gpio, Alexandre Courbot, Varka Bhadram

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-19  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-19  8:05 [PATCH gpio] gpio-amd8111: add release_region on ioport_map failure varkabhadram
2015-01-19  8:49 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.