aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>2005-08-25 16:14:06 -0400
committerDave Jones <davej@redhat.com>2005-09-01 01:21:28 -0400
commit8085e1f1f0645fc6ddefcb54fdcba95808df5049 (patch)
tree9e275032a6084be99b2e7cd1d63bfd42b990d05a /drivers/cpufreq
parent6b39374a27eb4be7e9d82145ae270ba02ea90dc8 (diff)
[CPUFREQ] Bugfix: Call driver exit in cpufreq_add_dev error path
A minor fix for cpufreq_add_dev() error path. We need to call driver->exit() if driver_init() call has succeeded. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 10b014982381..109d62ccf651 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -627,7 +627,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
627 627
628 ret = kobject_register(&policy->kobj); 628 ret = kobject_register(&policy->kobj);
629 if (ret) 629 if (ret)
630 goto err_out; 630 goto err_out_driver_exit;
631 631
632 /* set up files for this cpu device */ 632 /* set up files for this cpu device */
633 drv_attr = cpufreq_driver->attr; 633 drv_attr = cpufreq_driver->attr;
@@ -673,6 +673,10 @@ err_out_unregister:
673 kobject_unregister(&policy->kobj); 673 kobject_unregister(&policy->kobj);
674 wait_for_completion(&policy->kobj_unregister); 674 wait_for_completion(&policy->kobj_unregister);
675 675
676err_out_driver_exit:
677 if (cpufreq_driver->exit)
678 cpufreq_driver->exit(policy);
679
676err_out: 680err_out:
677 kfree(policy); 681 kfree(policy);
678 682