Commit ca5be902 authored by Linus Walleij's avatar Linus Walleij

drm/mcde: Fix uninitialized variable

We need to handle the case when of_drm_find_bridge() returns
NULL.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618115245.13915-1-linus.walleij@linaro.org
parent 1e612a0f
...@@ -317,7 +317,7 @@ static int mcde_probe(struct platform_device *pdev) ...@@ -317,7 +317,7 @@ static int mcde_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct drm_device *drm; struct drm_device *drm;
struct mcde *mcde; struct mcde *mcde;
struct component_match *match; struct component_match *match = NULL;
struct resource *res; struct resource *res;
u32 pid; u32 pid;
u32 val; u32 val;
...@@ -483,6 +483,10 @@ static int mcde_probe(struct platform_device *pdev) ...@@ -483,6 +483,10 @@ static int mcde_probe(struct platform_device *pdev)
} }
put_device(p); put_device(p);
} }
if (!match) {
dev_err(dev, "no matching components\n");
return -ENODEV;
}
if (IS_ERR(match)) { if (IS_ERR(match)) {
dev_err(dev, "could not create component match\n"); dev_err(dev, "could not create component match\n");
ret = PTR_ERR(match); ret = PTR_ERR(match);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment