From: Nicolas Dichtel Date: Wed, 13 May 2015 11:43:09 +0000 (+0200) Subject: netns: fix unbalanced spin_lock on error X-Git-Tag: v5.15~15591^2~284 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=0c58a2db91747c841d042b1d56615fb1eaf138c7;p=mirror_ubuntu-kernels.git 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 Signed-off-by: Nicolas Dichtel Signed-off-by: David S. Miller --- 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; }