From 73bab9770620b7701f38cc387c831d03a3a28279 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 20 Jun 2019 16:12:37 -0600 Subject: [PATCH] UPSTREAM: coresight: Potential uninitialized variable in probe() (Upstream commit 0530ef6b41e80c5cc979e0e50682302161edb6b7). The "drvdata->atclk" clock is optional, but if it gets set to an error pointer then we're accidentally return an uninitialized variable instead of success. Fixes: 78e6427b4e7b ("coresight: funnel: Support static funnel") Signed-off-by: Dan Carpenter Signed-off-by: Mathieu Poirier Cc: stable Link: https://lore.kernel.org/r/20190620221237.3536-6-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman Bug: 140266694 Bug: 151593592 Signed-off-by: Yabin Cui Change-Id: Ie1f1a45b66f351b53c440d788888c201cb4bce7f --- drivers/hwtracing/coresight/coresight-funnel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c index 397ec75f7b61..1b4a25b9ef35 100644 --- a/drivers/hwtracing/coresight/coresight-funnel.c +++ b/drivers/hwtracing/coresight/coresight-funnel.c @@ -262,6 +262,7 @@ static int funnel_probe(struct device *dev, struct resource *res) } pm_runtime_put(dev); + ret = 0; out_disable_clk: if (ret && !IS_ERR_OR_NULL(drvdata->atclk))