提交 0c58a2db 编写于 作者: N Nicolas Dichtel 提交者: David S. Miller

netns: fix unbalanced spin_lock on error

Unlock was missing on error path.

Fixes: 95f38411 ("netns: use a spin_lock to protect nsid management")
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ef7f3a5c
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册