[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190924164144.25591-2-sashal@kernel.org>
Date: Tue, 24 Sep 2019 12:40:18 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Linus Walleij <linus.walleij@...aro.org>,
Dan Carpenter <dan.carpenter@...cle.com>,
Sasha Levin <sashal@...nel.org>,
dri-devel@...ts.freedesktop.org
Subject: [PATCH AUTOSEL 5.3 02/87] drm/mcde: Fix uninitialized variable
From: Linus Walleij <linus.walleij@...aro.org>
[ Upstream commit ca5be902a87ddccc88144f2dea21b5f0814391ef ]
We need to handle the case when of_drm_find_bridge() returns
NULL.
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Acked-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618115245.13915-1-linus.walleij@linaro.org
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/gpu/drm/mcde/mcde_drv.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index baf63fb6850a4..a810568c76df7 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);
--
2.20.1
Powered by blists - more mailing lists