diff mbox

[1/1] NET: net_namespace, fix lock imbalance

Message ID 1232210832-30041-1-git-send-email-jirislaby@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jiri Slaby Jan. 17, 2009, 4:47 p.m. UTC
register_pernet_gen_subsys omits mutex_unlock in one fail path.
Fix it.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
---
 net/core/net_namespace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

David Miller Jan. 18, 2009, 7:08 a.m. UTC | #1
From: Jiri Slaby <jirislaby@gmail.com>
Date: Sat, 17 Jan 2009 17:47:12 +0100

> register_pernet_gen_subsys omits mutex_unlock in one fail path.
> Fix it.
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 55cffad..55151fa 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -341,8 +341,8 @@  again:
 	rv = register_pernet_operations(first_device, ops);
 	if (rv < 0)
 		ida_remove(&net_generic_ids, *id);
-	mutex_unlock(&net_mutex);
 out:
+	mutex_unlock(&net_mutex);
 	return rv;
 }
 EXPORT_SYMBOL_GPL(register_pernet_gen_subsys);