]> err.no Git - linux-2.6/commitdiff
[CPUFREQ] check return value of sysfs_create_file
authorThomas Renninger <trenn@suse.de>
Mon, 21 May 2007 12:20:04 +0000 (07:20 -0500)
committerDave Jones <davej@redhat.com>
Tue, 29 May 2007 20:56:40 +0000 (16:56 -0400)
Eliminate build warning (sysfs_create_file return value must be checked)

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dave Jones <davej@redhat.com>
drivers/cpufreq/cpufreq.c

index eb37fba9b7efccf163badc70450aee38873b60d3..0521427a571e3aae093b95cc6e9e34ed644c463d 100644 (file)
@@ -826,13 +826,18 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
        /* 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) {