summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-amd8111.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-amd8111.c')
-rw-r--r--drivers/gpio/gpio-amd8111.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-amd8111.c b/drivers/gpio/gpio-amd8111.c
index d3d2d1099f6..d00d81928fe 100644
--- a/drivers/gpio/gpio-amd8111.c
+++ b/drivers/gpio/gpio-amd8111.c
@@ -213,6 +213,12 @@ found:
goto out;
}
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;
+ }
gp.pdev = pdev;
gp.chip.dev = &pdev->dev;