summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2015-03-29 05:37:20 +0300
committerLinus Walleij <linus.walleij@linaro.org>2015-04-08 09:53:57 +0200
commit33c07b46774219ceaa2e6650413aa4d2cd6d6dd0 (patch)
tree21cd7c318b1be036f285db95a0c50a2f3b0b0be7 /drivers/gpio
parentcbfb3ea7f8c8da2e12d6d5aeca6d483de4297427 (diff)
downloadlinux-33c07b46774219ceaa2e6650413aa4d2cd6d6dd0.tar.gz
linux-33c07b46774219ceaa2e6650413aa4d2cd6d6dd0.tar.bz2
linux-33c07b46774219ceaa2e6650413aa4d2cd6d6dd0.zip
gpio: x-gene: fix devm_ioremap_resource() check
devm_ioremap_resource() returns IOMEM_ERR_PTR() and it never returns NULL, fix the check to prevent access to invalid virtual address. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-xgene-sb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c
index b6a15c39293e..fb9d29a5d584 100644
--- a/drivers/gpio/gpio-xgene-sb.c
+++ b/drivers/gpio/gpio-xgene-sb.c
@@ -93,7 +93,7 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
regs = devm_ioremap_resource(&pdev->dev, res);
- if (!regs)
+ if (IS_ERR(regs))
return PTR_ERR(regs);
ret = bgpio_init(&priv->bgc, &pdev->dev, 4,