aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 5e626b12b97e..79581fab82d6 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -841,19 +841,25 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
841 drv_attr = cpufreq_driver->attr; 841 drv_attr = cpufreq_driver->attr;
842 while ((drv_attr) && (*drv_attr)) { 842 while ((drv_attr) && (*drv_attr)) {
843 ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr)); 843 ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
844 if (ret) 844 if (ret) {
845 unlock_policy_rwsem_write(cpu);
845 goto err_out_driver_exit; 846 goto err_out_driver_exit;
847 }
846 drv_attr++; 848 drv_attr++;
847 } 849 }
848 if (cpufreq_driver->get){ 850 if (cpufreq_driver->get){
849 ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr); 851 ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr);
850 if (ret) 852 if (ret) {
853 unlock_policy_rwsem_write(cpu);
851 goto err_out_driver_exit; 854 goto err_out_driver_exit;
855 }
852 } 856 }
853 if (cpufreq_driver->target){ 857 if (cpufreq_driver->target){
854 ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr); 858 ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
855 if (ret) 859 if (ret) {
860 unlock_policy_rwsem_write(cpu);
856 goto err_out_driver_exit; 861 goto err_out_driver_exit;
862 }
857 } 863 }
858 864
859 spin_lock_irqsave(&cpufreq_driver_lock, flags); 865 spin_lock_irqsave(&cpufreq_driver_lock, flags);