All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] coresight: potential uninitialized variable in probe()
@ 2019-06-13  6:58 ` Dan Carpenter
  0 siblings, 0 replies; 18+ messages in thread
From: Dan Carpenter @ 2019-06-13  6:58 UTC (permalink / raw)
  To: Mathieu Poirier, Leo Yan
  Cc: Alexander Shishkin, kernel-janitors, linux-kernel,
	linux-arm-kernel, Suzuki K Poulose

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 <dan.carpenter@oracle.com>
---
 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 5867fcb4503b..fa97cb9ab4f9 100644
--- a/drivers/hwtracing/coresight/coresight-funnel.c
+++ b/drivers/hwtracing/coresight/coresight-funnel.c
@@ -244,6 +244,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))
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-06-17 19:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-13  6:58 [PATCH] coresight: potential uninitialized variable in probe() Dan Carpenter
2019-06-13  6:58 ` Dan Carpenter
2019-06-13  6:58 ` Dan Carpenter
2019-06-13  7:49 ` Leo Yan
2019-06-13  7:49   ` Leo Yan
2019-06-13  7:49   ` Leo Yan
2019-06-13  8:14   ` Dan Carpenter
2019-06-13  8:14     ` Dan Carpenter
2019-06-13  8:14     ` Dan Carpenter
2019-06-13  9:56     ` Leo Yan
2019-06-13  9:56       ` Leo Yan
2019-06-13  9:56       ` Leo Yan
2019-06-13 10:10       ` Leo Yan
2019-06-13 10:10         ` Leo Yan
2019-06-13 10:10         ` Leo Yan
2019-06-17 19:27 ` Mathieu Poirier
2019-06-17 19:27   ` Mathieu Poirier
2019-06-17 19:27   ` Mathieu Poirier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.