diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-10-03 11:56:50 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-29 20:21:23 -0400 |
commit | 0d09d3125642ac1f02937e577819dbc515291d93 (patch) | |
tree | f89ef56df320e0da2757642fc42828adcc24021e /drivers/cpuidle/driver.c | |
parent | 6d281e97a1c53abb73477a34806c1a000409c4b9 (diff) |
cpuidle: call cpuidle_get_driver() from after taking cpuidle_driver_lock
There are a few cpuidle_get_driver() calls that aren't made under
cpuidle_driver_lock which is incorrect.
Fix them by calling cpuidle_get_driver() after taking cpuidle_driver_lock.
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle/driver.c')
-rw-r--r-- | drivers/cpuidle/driver.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c index a930005d5a3a..2458a741ad45 100644 --- a/drivers/cpuidle/driver.c +++ b/drivers/cpuidle/driver.c | |||
@@ -338,10 +338,11 @@ struct cpuidle_driver *cpuidle_driver_ref(void) | |||
338 | */ | 338 | */ |
339 | void cpuidle_driver_unref(void) | 339 | void cpuidle_driver_unref(void) |
340 | { | 340 | { |
341 | struct cpuidle_driver *drv = cpuidle_get_driver(); | 341 | struct cpuidle_driver *drv; |
342 | 342 | ||
343 | spin_lock(&cpuidle_driver_lock); | 343 | spin_lock(&cpuidle_driver_lock); |
344 | 344 | ||
345 | drv = cpuidle_get_driver(); | ||
345 | if (drv && !WARN_ON(drv->refcnt <= 0)) | 346 | if (drv && !WARN_ON(drv->refcnt <= 0)) |
346 | drv->refcnt--; | 347 | drv->refcnt--; |
347 | 348 | ||