Messages in this thread Patch in this message |  | | From | Linus Torvalds <> | | Date | Sun, 20 Jan 2013 17:56:14 -0800 | | Subject | Re: [patch] module: potential deadlock in error path |
| |
On Sun, Jan 20, 2013 at 5:20 PM, Rusty Russell <rusty@rustcorp.com.au> wrote: > Dan Carpenter <dan.carpenter@oracle.com> writes: >> We take the lock twice if we hit this goto. >> >> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> > > Damn, just pushed that to Linus: should have read mail first. > > I've added this, thanks.
I'm not pulling this. It seems stupid.
Why isn't the fix just this (whitespace-damaged, cut-and-pasted) one-liner instead? I may be blind, but as far as I cal tell, there's exactly one single place we do that "giti ddebug_cleanup", and it wants to unlock the mutex, so we should just move the unlock down one line instead.
Hmm? Is there some hidden magic going on that I can't see?
Linus
--- diff --git a/kernel/module.c b/kernel/module.c index d25e359279ae..eab08274ec9b 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -3274,8 +3274,8 @@ again: /* module_bug_cleanup needs module_mutex protection */ mutex_lock(&module_mutex); module_bug_cleanup(mod); - mutex_unlock(&module_mutex); ddebug_cleanup: + mutex_unlock(&module_mutex); dynamic_debug_remove(info->debug); synchronize_sched(); kfree(mod->args);
|  |