aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-01-18 16:40:54 -0500
committerDave Jones <davej@redhat.com>2006-01-18 16:53:46 -0500
commitf3876c1bc7a23d4712c824f2ef5ec7d138259594 (patch)
treecbfe19995ff8d0aafe75bf1e7de6fadd050f5743 /drivers/cpufreq
parent83933af4720b282f6f6a0b6c05a2a47b4cf08819 (diff)
[CPUFREQ] Don't free held mutex in cpufreq_add_dev()
Make the cpufreq code play nicely with the mutex debugging code: don't free a held mutex. Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 0675d9f02e34..0a6c4c8642e7 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -612,6 +612,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
612 ret = cpufreq_driver->init(policy); 612 ret = cpufreq_driver->init(policy);
613 if (ret) { 613 if (ret) {
614 dprintk("initialization failed\n"); 614 dprintk("initialization failed\n");
615 mutex_unlock(&policy->lock);
615 goto err_out; 616 goto err_out;
616 } 617 }
617 618
@@ -623,9 +624,10 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
623 strlcpy(policy->kobj.name, "cpufreq", KOBJ_NAME_LEN); 624 strlcpy(policy->kobj.name, "cpufreq", KOBJ_NAME_LEN);
624 625
625 ret = kobject_register(&policy->kobj); 626 ret = kobject_register(&policy->kobj);
626 if (ret) 627 if (ret) {
628 mutex_unlock(&policy->lock);
627 goto err_out_driver_exit; 629 goto err_out_driver_exit;
628 630 }
629 /* set up files for this cpu device */ 631 /* set up files for this cpu device */
630 drv_attr = cpufreq_driver->attr; 632 drv_attr = cpufreq_driver->attr;
631 while ((drv_attr) && (*drv_attr)) { 633 while ((drv_attr) && (*drv_attr)) {