Message ID | 7b0b49dff962845b26918fce56cbe4444175db4f.1719234744.git.tanggeliang@kylinos.cn |
---|---|
State | Superseded |
Headers | show |
Series | Fixes for BPF selftests on loongarch | expand |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index b24d74616637..8e926018d011 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -434,7 +434,8 @@ int inet_release(struct socket *sock) if (sock_flag(sk, SOCK_LINGER) && !(current->flags & PF_EXITING)) timeout = sk->sk_lingertime; - sk->sk_prot->close(sk, timeout); + if (sk->sk_prot && sk->sk_prot->close) + sk->sk_prot->close(sk, timeout); sock->sk = NULL; } return 0;