summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-xgene.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-xgene.c')
-rw-r--r--drivers/gpio/gpio-xgene.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index c0aa387664bf..0dc916191689 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -173,6 +173,11 @@ static int xgene_gpio_probe(struct platform_device *pdev)
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ err = -EINVAL;
+ goto err;
+ }
+
gpio->base = devm_ioremap_nocache(&pdev->dev, res->start,
resource_size(res));
if (!gpio->base) {