mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
netns: fix unbalanced spin_lock on error
Unlock was missing on error path.
Fixes: 95f38411df
("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>
This commit is contained in:
parent
ef7f3a5c71
commit
0c58a2db91
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue