diff mbox series

[v2] drm/mcde: Fix uninitialized variable

Message ID 20190618115245.13915-1-linus.walleij@linaro.org (mailing list archive)
State Mainlined
Commit ca5be902a87ddccc88144f2dea21b5f0814391ef
Headers show
Series [v2] drm/mcde: Fix uninitialized variable | expand

Commit Message

Linus Walleij June 18, 2019, 11:52 a.m. UTC
We need to handle the case when of_drm_find_bridge() returns
NULL.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Account for both NULL and error pointers by two clauses.
---
 drivers/gpu/drm/mcde/mcde_drv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Dan Carpenter June 18, 2019, 12:30 p.m. UTC | #1
Thanks!

regards,
dan carpenter
Linus Walleij June 24, 2019, 10:09 p.m. UTC | #2
On Tue, Jun 18, 2019 at 2:31 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:

> Thanks!

Recording this as Acked-by: when applying.

Yours,
Linus Walleij
Dan Carpenter June 25, 2019, 7:13 a.m. UTC | #3
On Tue, Jun 25, 2019 at 12:09:54AM +0200, Linus Walleij wrote:
> On Tue, Jun 18, 2019 at 2:31 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> > Thanks!
> 
> Recording this as Acked-by: when applying.
> 

That's is an honour for me.  I figured that your Signed-off-by dwarfed
my Ack.  :P

regards,
dan carpenter
Linus Walleij June 25, 2019, 8:24 a.m. UTC | #4
On Tue, Jun 25, 2019 at 9:14 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Tue, Jun 25, 2019 at 12:09:54AM +0200, Linus Walleij wrote:
> > On Tue, Jun 18, 2019 at 2:31 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >
> > > Thanks!
> >
> > Recording this as Acked-by: when applying.
> >
>
> That's is an honour for me.  I figured that your Signed-off-by dwarfed
> my Ack.  :P

Not at all. In DRM we have a rule to not push any changes without
a proper ACK.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index baf63fb6850a..a810568c76df 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,6 +485,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);