diff options
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index e1d08f69fd39..ab4eb5eb5d07 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1380,14 +1380,14 @@ static inline int tcp_win_from_space(const struct sock *sk, int space) | |||
1380 | /* Note: caller must be prepared to deal with negative returns */ | 1380 | /* Note: caller must be prepared to deal with negative returns */ |
1381 | static inline int tcp_space(const struct sock *sk) | 1381 | static inline int tcp_space(const struct sock *sk) |
1382 | { | 1382 | { |
1383 | return tcp_win_from_space(sk, sk->sk_rcvbuf - | 1383 | return tcp_win_from_space(sk, READ_ONCE(sk->sk_rcvbuf) - |
1384 | READ_ONCE(sk->sk_backlog.len) - | 1384 | READ_ONCE(sk->sk_backlog.len) - |
1385 | atomic_read(&sk->sk_rmem_alloc)); | 1385 | atomic_read(&sk->sk_rmem_alloc)); |
1386 | } | 1386 | } |
1387 | 1387 | ||
1388 | static inline int tcp_full_space(const struct sock *sk) | 1388 | static inline int tcp_full_space(const struct sock *sk) |
1389 | { | 1389 | { |
1390 | return tcp_win_from_space(sk, sk->sk_rcvbuf); | 1390 | return tcp_win_from_space(sk, READ_ONCE(sk->sk_rcvbuf)); |
1391 | } | 1391 | } |
1392 | 1392 | ||
1393 | extern void tcp_openreq_init_rwin(struct request_sock *req, | 1393 | extern void tcp_openreq_init_rwin(struct request_sock *req, |