[PATCH] drm/mcde: Fix uninitialized variable

Linus Walleij linus.walleij at linaro.org
Wed Jun 12 13:30:38 UTC 2019


We need to handle the case when of_drm_find_bridge() returns
NULL.

Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
Cc: Dan Carpenter <dan.carpenter at oracle.com>
Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
---
 drivers/gpu/drm/mcde/mcde_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index baf63fb6850a..bc11c446e594 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -319,7 +319,7 @@ static int mcde_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct drm_device *drm;
 	struct mcde *mcde;
-	struct component_match *match;
+	struct component_match *match = NULL;
 	struct resource *res;
 	u32 pid;
 	u32 val;
@@ -485,7 +485,7 @@ static int mcde_probe(struct platform_device *pdev)
 		}
 		put_device(p);
 	}
-	if (IS_ERR(match)) {
+	if (IS_ERR_OR_NULL(match)) {
 		dev_err(dev, "could not create component match\n");
 		ret = PTR_ERR(match);
 		goto clk_disable;
-- 
2.20.1



More information about the dri-devel mailing list