netns: fix unbalanced spin_lock on error
[cascardo/linux.git] / net / core / net_namespace.c
index cbee75f..d2f42da 100644 (file)
@@ -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;
        }