public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] module: potential deadlock in error path
@ 2013-01-18  7:43 Dan Carpenter
  2013-01-21  1:20 ` Rusty Russell
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2013-01-18  7:43 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, kernel-janitors

We take the lock twice if we hit this goto.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/kernel/module.c b/kernel/module.c
index d25e359..2eefa7d 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3239,8 +3239,10 @@ again:
 	mutex_lock(&module_mutex);
 	/* Find duplicate symbols (must be called under lock). */
 	err = verify_export_symbols(mod);
-	if (err < 0)
+	if (err < 0) {
+		mutex_unlock(&module_mutex);
 		goto ddebug_cleanup;
+	}
 
 	/* This relies on module_mutex for list integrity. */
 	module_bug_finalize(info->hdr, info->sechdrs, mod);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-21  8:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-18  7:43 [patch] module: potential deadlock in error path Dan Carpenter
2013-01-21  1:20 ` Rusty Russell
2013-01-21  1:56   ` Linus Torvalds
2013-01-21  3:52     ` Rusty Russell
2013-01-21  4:37       ` Linus Torvalds
2013-01-21  8:58         ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox