Skip to content

Commit

Permalink
thermal: clock_cooling: Fix missing mutex_init()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Zhang Rui committed Aug 8, 2016
1 parent f4c5924 commit 165989a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/thermal/clock_cooling.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 165989a

Please sign in to comment.