summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-01-18 13:40:54 -0800
committerDave Jones <davej@redhat.com>2006-01-18 13:53:46 -0800
commitf3876c1bc7a23d4712c824f2ef5ec7d138259594 (patch)
treecbfe19995ff8d0aafe75bf1e7de6fadd050f5743 /drivers/cpufreq/cpufreq.c
parent83933af4720b282f6f6a0b6c05a2a47b4cf08819 (diff)
downloadblackbird-op-linux-f3876c1bc7a23d4712c824f2ef5ec7d138259594.tar.gz
blackbird-op-linux-f3876c1bc7a23d4712c824f2ef5ec7d138259594.zip
[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/cpufreq.c')
-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)
ret = cpufreq_driver->init(policy);
if (ret) {
dprintk("initialization failed\n");
+ mutex_unlock(&policy->lock);
goto err_out;
}
@@ -623,9 +624,10 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
strlcpy(policy->kobj.name, "cpufreq", KOBJ_NAME_LEN);
ret = kobject_register(&policy->kobj);
- if (ret)
+ if (ret) {
+ mutex_unlock(&policy->lock);
goto err_out_driver_exit;
-
+ }
/* set up files for this cpu device */
drv_attr = cpufreq_driver->attr;
while ((drv_attr) && (*drv_attr)) {
OpenPOWER on IntegriCloud