Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0a4b2ccc555fa2ca6873d60219047104e4805d45
Commit:     0a4b2ccc555fa2ca6873d60219047104e4805d45
Parent:     489dc5cb18932d3cedaef03e84890475db17a843
Author:     Thomas Renninger <[EMAIL PROTECTED]>
AuthorDate: Mon May 21 07:20:04 2007 -0500
Committer:  Dave Jones <[EMAIL PROTECTED]>
CommitDate: Tue May 29 16:56:40 2007 -0400

    [CPUFREQ] check return value of sysfs_create_file
    
    Eliminate build warning (sysfs_create_file return value must be checked)
    
    Signed-off-by: Thomas Renninger <[EMAIL PROTECTED]>
    Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
---
 drivers/cpufreq/cpufreq.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index eb37fba..0521427 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -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) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to