linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] thermal: clock_cooling: Fix missing mutex_init()
@ 2016-07-25  7:01 Wei Yongjun
  0 siblings, 0 replies; only message in thread
From: Wei Yongjun @ 2016-07-25  7:01 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin; +Cc: Wei Yongjun, linux-pm

The driver allocates the mutex but not initialize it.
Use mutex_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
---
 drivers/thermal/clock_cooling.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/clock_cooling.c b/drivers/thermal/clock_cooling.c
index 1b4ff0f..ed5dd0e 100644
--- a/drivers/thermal/clock_cooling.c
+++ b/drivers/thermal/clock_cooling.c
@@ -426,6 +426,7 @@ clock_cooling_register(struct device *dev, const char *clock_name)
 	if (!ccdev)
 		return ERR_PTR(-ENOMEM);
 
+	mutex_init(&ccdev->lock);
 	ccdev->dev = dev;
 	ccdev->clk = devm_clk_get(dev, clock_name);
 	if (IS_ERR(ccdev->clk))


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-25  7:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-25  7:01 [PATCH -next] thermal: clock_cooling: Fix missing mutex_init() Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).