summaryrefslogtreecommitdiff
path: root/net/core/net_namespace.c
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2015-05-13 13:43:09 +0200
committerDavid S. Miller <davem@davemloft.net>2015-05-14 22:36:31 -0400
commit0c58a2db91747c841d042b1d56615fb1eaf138c7 (patch)
treee56a197b1a9446464adad8eb81b669bd4f0456b9 /net/core/net_namespace.c
parentef7f3a5c7149ad2dbd1d8a71d0aa88a02d1dbcb8 (diff)
netns: fix unbalanced spin_lock on error
Unlock was missing on error path. Fixes: 95f38411df05 ("netns: use a spin_lock to protect nsid management") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/net_namespace.c')
-rw-r--r--net/core/net_namespace.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index cbee75f2fc28..d2f42da9479b 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -565,6 +565,7 @@ static int rtnl_net_newid(struct sk_buff *skb, struct nlmsghdr *nlh)
spin_lock_irqsave(&nsid_lock, flags);
if (__peernet2id(net, peer) >= 0) {
+ spin_unlock_irqrestore(&nsid_lock, flags);
err = -EEXIST;
goto out;
}