From: Linus Walleij <linus.walleij@linaro.org>
Date: Tue, 18 Jun 2019 13:52:45 +0200
Subject: drm/mcde: Fix uninitialized variable
Git-commit: ca5be902a87ddccc88144f2dea21b5f0814391ef
Patch-mainline: 5.4-rc1
References: bnc#1151927 5.3.5
We need to handle the case when of_drm_find_bridge() returns
NULL.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618115245.13915-1-linus.walleij@linaro.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/gpu/drm/mcde/mcde_drv.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- 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_de
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,6 +485,10 @@ static int mcde_probe(struct platform_de
}
put_device(p);
}
+ if (!match) {
+ dev_err(dev, "no matching components\n");
+ return -ENODEV;
+ }
if (IS_ERR(match)) {
dev_err(dev, "could not create component match\n");
ret = PTR_ERR(match);