gpio-amd8111: add release_region on ioport_map failure
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.
Signed-off-by Varka Bhadram <[email protected]>
Reported-by Alexandre Courbot <[email protected]>
--- drivers/gpio/gpio-amd8111.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-amd8111.c +1 -0
@@ -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
Quoted 9 lines · On Mon, Jan 19, 2015 at 9:05 AM, <[email protected]> wrote:
From: Varka Bhadram <[email protected]>
Commit
ffe4770b9b3483f74("gpio-amd8111: checkioport_mapreturn value") adds the error check onioport_map(). It doesnt release the requested region.On failure this patch release the region that has requested before.
Signed-off-by Varka Bhadram <[email protected]>Reported-by Alexandre Courbot <[email protected]>
Patch applied.
Yours,
Linus Walleij