diff options
| author | Wei Yongjun <weiyj.lk@gmail.com> | 2016-07-25 03:01:19 -0400 |
|---|---|---|
| committer | Zhang Rui <rui.zhang@intel.com> | 2016-08-07 22:57:39 -0400 |
| commit | 165989a5b667b90589f21c8affe496ad21f08591 (patch) | |
| tree | 2e90ffc74b93cac9d52be32225b84eb4a24a26c7 /drivers/thermal | |
| parent | f4c592439b144ef1de66eac764140643a54099eb (diff) | |
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>
Diffstat (limited to 'drivers/thermal')
| -rw-r--r-- | drivers/thermal/clock_cooling.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/thermal/clock_cooling.c b/drivers/thermal/clock_cooling.c index 1b4ff0f4c716..ed5dd0e88657 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) | |||
| 426 | if (!ccdev) | 426 | if (!ccdev) |
| 427 | return ERR_PTR(-ENOMEM); | 427 | return ERR_PTR(-ENOMEM); |
| 428 | 428 | ||
| 429 | mutex_init(&ccdev->lock); | ||
| 429 | ccdev->dev = dev; | 430 | ccdev->dev = dev; |
| 430 | ccdev->clk = devm_clk_get(dev, clock_name); | 431 | ccdev->clk = devm_clk_get(dev, clock_name); |
| 431 | if (IS_ERR(ccdev->clk)) | 432 | if (IS_ERR(ccdev->clk)) |
