Skip to content

Commit 165989a

Browse files
weiyjzhang-rui
authored andcommitted
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>
1 parent f4c5924 commit 165989a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/thermal/clock_cooling.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ clock_cooling_register(struct device *dev, const char *clock_name)
426426
if (!ccdev)
427427
return ERR_PTR(-ENOMEM);
428428

429+
mutex_init(&ccdev->lock);
429430
ccdev->dev = dev;
430431
ccdev->clk = devm_clk_get(dev, clock_name);
431432
if (IS_ERR(ccdev->clk))

0 commit comments

Comments
 (0)