[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFzEkSOWL13cX2xaYttPF5=Qpvya9Yapk-RC8KQ5=QJk+w@mail.gmail.com>
Date: Sun, 20 Jan 2013 17:56:14 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Rusty Russell <rusty@...tcorp.com.au>
Cc: Dan Carpenter <dan.carpenter@...cle.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
kernel-janitors <kernel-janitors@...r.kernel.org>,
Alexander Graf <agraf@...e.de>,
Prarit Bhargava <prarit@...hat.com>,
Sasha Levin <sasha.levin@...cle.com>
Subject: Re: [patch] module: potential deadlock in error path
On Sun, Jan 20, 2013 at 5:20 PM, Rusty Russell <rusty@...tcorp.com.au> wrote:
> Dan Carpenter <dan.carpenter@...cle.com> writes:
>> We take the lock twice if we hit this goto.
>>
>> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists