diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 8c45d7e35ee97c973246cbdb3c90ab31a175d944..a5f4f661fa62c55427021d1becbc699519b03053 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -1384,7 +1384,7 @@ static void rtnetlink_net_exit(struct net *net) * free. */ sk->sk_net = get_net(&init_net); - sock_put(sk); + sock_release(net->rtnl->sk_socket); net->rtnl = NULL; } } diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 8ddcd3f91a175c6adbe42ec51b1dd54a83544a83..4e5216e9aacb3739787138fe4db8b6ef523226e9 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -881,7 +881,7 @@ static void nl_fib_lookup_exit(struct net *net) * initial network namespace. So the socket will be safe to free. */ net->ipv4.fibnl->sk_net = get_net(&init_net); - sock_put(net->ipv4.fibnl); + sock_release(net->ipv4.fibnl->sk_socket); } static void fib_disable_ip(struct net_device *dev, int force)