From: Andrew Morton Date: Wed, 18 Jan 2006 21:40:54 +0000 (-0800) Subject: [CPUFREQ] Don't free held mutex in cpufreq_add_dev() X-Git-Tag: v2.6.16-rc2~240^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3876c1bc7a23d4712c824f2ef5ec7d138259594;p=linux-2.6 [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 Signed-off-by: Andrew Morton Signed-off-by: Dave Jones --- diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 0675d9f02e..0a6c4c8642 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)) {