Skip to content

Commit

Permalink
drm/mcde: Fix uninitialized variable
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Walleij committed Jun 24, 2019
1 parent 1e612a0 commit ca5be90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/gpu/drm/mcde/mcde_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,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;
Expand Down Expand Up @@ -483,6 +483,10 @@ static int mcde_probe(struct platform_device *pdev)
}
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);
Expand Down

0 comments on commit ca5be90

Please sign in to comment.