aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/sysfs.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-10-03 11:56:50 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-29 20:21:23 -0400
commit0d09d3125642ac1f02937e577819dbc515291d93 (patch)
treef89ef56df320e0da2757642fc42828adcc24021e /drivers/cpuidle/sysfs.c
parent6d281e97a1c53abb73477a34806c1a000409c4b9 (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/sysfs.c')
-rw-r--r--drivers/cpuidle/sysfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index 8739cc05228c..a0223933536e 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -52,9 +52,10 @@ static ssize_t show_current_driver(struct device *dev,
52 char *buf) 52 char *buf)
53{ 53{
54 ssize_t ret; 54 ssize_t ret;
55 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); 55 struct cpuidle_driver *cpuidle_driver;
56 56
57 spin_lock(&cpuidle_driver_lock); 57 spin_lock(&cpuidle_driver_lock);
58 cpuidle_driver = cpuidle_get_driver();
58 if (cpuidle_driver) 59 if (cpuidle_driver)
59 ret = sprintf(buf, "%s\n", cpuidle_driver->name); 60 ret = sprintf(buf, "%s\n", cpuidle_driver->name);
60 else 61 else