diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2008-07-13 23:00:45 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2008-10-09 13:52:43 -0400 |
commit | 888a794cacd8950ac6be701db20b62a4ab2ce90c (patch) | |
tree | 056e6cdbd70860dc226887727e632947b4992dd7 /drivers/cpufreq/cpufreq_ondemand.c | |
parent | 847aef6ffd85787b62395b64719f8f7c5975bf1b (diff) |
[CPUFREQ] add error handling for cpufreq_register_governor() error
Add error handling for cpufreq_register_governor() error
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: cpufreq@lists.linux.org.uk
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 33855cb3cf16..67c9d4f9edc0 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -589,12 +589,18 @@ EXPORT_SYMBOL(cpufreq_gov_ondemand); | |||
589 | 589 | ||
590 | static int __init cpufreq_gov_dbs_init(void) | 590 | static int __init cpufreq_gov_dbs_init(void) |
591 | { | 591 | { |
592 | int err; | ||
593 | |||
592 | kondemand_wq = create_workqueue("kondemand"); | 594 | kondemand_wq = create_workqueue("kondemand"); |
593 | if (!kondemand_wq) { | 595 | if (!kondemand_wq) { |
594 | printk(KERN_ERR "Creation of kondemand failed\n"); | 596 | printk(KERN_ERR "Creation of kondemand failed\n"); |
595 | return -EFAULT; | 597 | return -EFAULT; |
596 | } | 598 | } |
597 | return cpufreq_register_governor(&cpufreq_gov_ondemand); | 599 | err = cpufreq_register_governor(&cpufreq_gov_ondemand); |
600 | if (err) | ||
601 | destroy_workqueue(kondemand_wq); | ||
602 | |||
603 | return err; | ||
598 | } | 604 | } |
599 | 605 | ||
600 | static void __exit cpufreq_gov_dbs_exit(void) | 606 | static void __exit cpufreq_gov_dbs_exit(void) |