Blob Blame History Raw
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Sun, 21 May 2017 01:01:52 +0000
Subject: drm/pl111: Fix return value check in pl111_amba_probe()
Git-commit: 665f37e7eec33223bdc50cc1b3e00bca97a30aea
Patch-mainline: v4.13-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170521010152.6186-1-weiyj.lk@gmail.com

Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/pl111/pl111_drv.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -200,9 +200,9 @@ static int pl111_amba_probe(struct amba_
 	drm->dev_private = priv;
 
 	priv->regs = devm_ioremap_resource(dev, &amba_dev->res);
-	if (!priv->regs) {
+	if (IS_ERR(priv->regs)) {
 		dev_err(dev, "%s failed mmio\n", __func__);
-		return -EINVAL;
+		return PTR_ERR(priv->regs);
 	}
 
 	/* turn off interrupts before requesting the irq */