Explorar o código

thermal: clock_cooling: Fix missing mutex_init()

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>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Wei Yongjun %!s(int64=9) %!d(string=hai) anos
pai
achega
165989a5b6
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      drivers/thermal/clock_cooling.c

+ 1 - 0
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))