lkml.org 
[lkml]   [2006]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 2.6.16-rc1-mm1
Dave Jones <davej@redhat.com> wrote:
>
> With the patch above we'll mutex_unlock twice.

I was just testing you.

> Is that allowed ? It sounds wrong to me.

It worked!


From: Andrew Morton <akpm@osdl.org>

Make the cpufreq code play nicely with the mutex debugging code: don't free a
held mutex.

Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

drivers/cpufreq/cpufreq.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN drivers/cpufreq/cpufreq.c~cpufreq-mutex-locking-fix drivers/cpufreq/cpufreq.c
--- devel/drivers/cpufreq/cpufreq.c~cpufreq-mutex-locking-fix 2006-01-18 13:37:09.000000000 -0800
+++ devel-akpm/drivers/cpufreq/cpufreq.c 2006-01-18 13:38:20.000000000 -0800
@@ -612,6 +612,7 @@ static int cpufreq_add_dev (struct sys_d
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_d
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)) {
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-18 22:44    [W:0.058 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site