Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0142f9dce8425da031d72dc3b70ee7161fcaaea2
Commit:     0142f9dce8425da031d72dc3b70ee7161fcaaea2
Parent:     5263bf65d6342e12ab716db8e529501670979321
Author:     Ahmed S. Darwish <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 5 05:44:54 2007 +0200
Committer:  Dave Jones <[EMAIL PROTECTED]>
CommitDate: Mon Jan 29 00:06:27 2007 -0500

    [CPUFREQ] check sysfs_create_link return value
    
    Trivial patch to check sysfs_create_link return values.
    Fail gracefully if needed.
    
    Signed-off-by: Ahmed Darwish <[EMAIL PROTECTED]>
    Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
---
 drivers/cpufreq/cpufreq.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index d913304..a45cc89 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -722,8 +722,13 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
                        spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
 
                        dprintk("CPU already managed, adding link\n");
-                       sysfs_create_link(&sys_dev->kobj,
-                                         &managed_policy->kobj, "cpufreq");
+                       ret = sysfs_create_link(&sys_dev->kobj,
+                                               &managed_policy->kobj,
+                                               "cpufreq");
+                       if (ret) {
+                               mutex_unlock(&policy->lock);
+                               goto err_out_driver_exit;
+                       }
 
                        cpufreq_debug_enable_ratelimit();
                        mutex_unlock(&policy->lock);
@@ -770,8 +775,12 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
                dprintk("CPU %u already managed, adding link\n", j);
                cpufreq_cpu_get(cpu);
                cpu_sys_dev = get_cpu_sysdev(j);
-               sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj,
-                                 "cpufreq");
+               ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj,
+                                       "cpufreq");
+               if (ret) {
+                       mutex_unlock(&policy->lock);
+                       goto err_out_unregister;
+               }
        }
 
        policy->governor = NULL; /* to assure that the starting sequence is
-
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