summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVarka Bhadram <varkabhadram@gmail.com>2014-12-29 14:09:01 +0530
committerLinus Walleij <linus.walleij@linaro.org>2015-01-15 17:23:21 +0100
commitffe4770b9b3483f74bccd0566fd1013ddc1b6d6b (patch)
treedf30d8826003036cfc96b036bbeb61d0724eecc2
parentda9df93e9e0fd1d8c14315c6c0f989a30c291a11 (diff)
downloadop-kernel-dev-ffe4770b9b3483f74bccd0566fd1013ddc1b6d6b.zip
op-kernel-dev-ffe4770b9b3483f74bccd0566fd1013ddc1b6d6b.tar.gz
gpio-amd8111: check ioport_map return value
ioport_map() may fail. Its safe to check the return value. Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpio-amd8111.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-amd8111.c b/drivers/gpio/gpio-amd8111.c
index d3d2d10..2c4d9ab 100644
--- a/drivers/gpio/gpio-amd8111.c
+++ b/drivers/gpio/gpio-amd8111.c
@@ -213,6 +213,11 @@ 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");
+ err = -ENOMEM;
+ goto out;
+ }
gp.pdev = pdev;
gp.chip.dev = &pdev->dev;
OpenPOWER on IntegriCloud