diff options
author | Ahmed S. Darwish <darwish.07@gmail.com> | 2007-01-04 22:44:54 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2007-01-29 00:06:27 -0500 |
commit | 0142f9dce8425da031d72dc3b70ee7161fcaaea2 (patch) | |
tree | e311911a8eda0b3608f567090714bd742bda07bf /drivers/cpufreq | |
parent | 5263bf65d6342e12ab716db8e529501670979321 (diff) |
[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 <darwish.07@gmail.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | 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 d91330432ba2..a45cc89e387a 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) | |||
722 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); | 722 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); |
723 | 723 | ||
724 | dprintk("CPU already managed, adding link\n"); | 724 | dprintk("CPU already managed, adding link\n"); |
725 | sysfs_create_link(&sys_dev->kobj, | 725 | ret = sysfs_create_link(&sys_dev->kobj, |
726 | &managed_policy->kobj, "cpufreq"); | 726 | &managed_policy->kobj, |
727 | "cpufreq"); | ||
728 | if (ret) { | ||
729 | mutex_unlock(&policy->lock); | ||
730 | goto err_out_driver_exit; | ||
731 | } | ||
727 | 732 | ||
728 | cpufreq_debug_enable_ratelimit(); | 733 | cpufreq_debug_enable_ratelimit(); |
729 | mutex_unlock(&policy->lock); | 734 | mutex_unlock(&policy->lock); |
@@ -770,8 +775,12 @@ static int cpufreq_add_dev (struct sys_device * sys_dev) | |||
770 | dprintk("CPU %u already managed, adding link\n", j); | 775 | dprintk("CPU %u already managed, adding link\n", j); |
771 | cpufreq_cpu_get(cpu); | 776 | cpufreq_cpu_get(cpu); |
772 | cpu_sys_dev = get_cpu_sysdev(j); | 777 | cpu_sys_dev = get_cpu_sysdev(j); |
773 | sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, | 778 | ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, |
774 | "cpufreq"); | 779 | "cpufreq"); |
780 | if (ret) { | ||
781 | mutex_unlock(&policy->lock); | ||
782 | goto err_out_unregister; | ||
783 | } | ||
775 | } | 784 | } |
776 | 785 | ||
777 | policy->governor = NULL; /* to assure that the starting sequence is | 786 | policy->governor = NULL; /* to assure that the starting sequence is |