summaryrefslogtreecommitdiff
path: root/include/net/inet_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/inet_common.h')
-rw-r--r--include/net/inet_common.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index 279f83591971..109e3ee9108c 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -41,7 +41,8 @@ int inet_recv_error(struct sock *sk, struct msghdr *msg, int len,
static inline void inet_ctl_sock_destroy(struct sock *sk)
{
- sock_release(sk->sk_socket);
+ if (sk)
+ sock_release(sk->sk_socket);
}
#endif