diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index e716b2ba00bb..e00cd9d0bec8 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -3061,8 +3061,11 @@ int sock_copy_user_timeval(struct __kernel_sock_timeval *tv, static inline bool sk_is_readable(struct sock *sk) { - if (sk->sk_prot->sock_is_readable) - return sk->sk_prot->sock_is_readable(sk); + const struct proto *prot = READ_ONCE(sk->sk_prot); + + if (prot->sock_is_readable) + return prot->sock_is_readable(sk); + return false; } #endif /* _SOCK_H */ |