/* set up files for this cpu device */
drv_attr = cpufreq_driver->attr;
while ((drv_attr) && (*drv_attr)) {
- sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
+ if (sysfs_create_file(&policy->kobj, &((*drv_attr)->attr)))
+ goto err_out_driver_exit;
drv_attr++;
}
- if (cpufreq_driver->get)
- sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr);
- if (cpufreq_driver->target)
- sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
+ if (cpufreq_driver->get){
+ if (sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr))
+ goto err_out_driver_exit;
+ }
+ if (cpufreq_driver->target){
+ if (sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr))
+ goto err_out_driver_exit;
+ }
spin_lock_irqsave(&cpufreq_driver_lock, flags);
for_each_cpu_mask(j, policy->cpus) {