diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index e0b5ca349049..48c2be43f856 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -1490,6 +1490,7 @@ static int do_setlink(const struct sk_buff *skb, goto errout; } if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) { + put_net(net); err = -EPERM; goto errout; }