diff options
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index dbd51cefaf02..094a6822c71d 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -496,7 +496,7 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait) | |||
496 | 496 | ||
497 | /* Connected or passive Fast Open socket? */ | 497 | /* Connected or passive Fast Open socket? */ |
498 | if (sk->sk_state != TCP_SYN_SENT && | 498 | if (sk->sk_state != TCP_SYN_SENT && |
499 | (sk->sk_state != TCP_SYN_RECV || tp->fastopen_rsk != NULL)) { | 499 | (sk->sk_state != TCP_SYN_RECV || tp->fastopen_rsk)) { |
500 | int target = sock_rcvlowat(sk, 0, INT_MAX); | 500 | int target = sock_rcvlowat(sk, 0, INT_MAX); |
501 | 501 | ||
502 | if (tp->urg_seq == tp->copied_seq && | 502 | if (tp->urg_seq == tp->copied_seq && |
@@ -1028,7 +1028,7 @@ static inline int select_size(const struct sock *sk, bool sg) | |||
1028 | 1028 | ||
1029 | void tcp_free_fastopen_req(struct tcp_sock *tp) | 1029 | void tcp_free_fastopen_req(struct tcp_sock *tp) |
1030 | { | 1030 | { |
1031 | if (tp->fastopen_req != NULL) { | 1031 | if (tp->fastopen_req) { |
1032 | kfree(tp->fastopen_req); | 1032 | kfree(tp->fastopen_req); |
1033 | tp->fastopen_req = NULL; | 1033 | tp->fastopen_req = NULL; |
1034 | } | 1034 | } |
@@ -1042,12 +1042,12 @@ static int tcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg, | |||
1042 | 1042 | ||
1043 | if (!(sysctl_tcp_fastopen & TFO_CLIENT_ENABLE)) | 1043 | if (!(sysctl_tcp_fastopen & TFO_CLIENT_ENABLE)) |
1044 | return -EOPNOTSUPP; | 1044 | return -EOPNOTSUPP; |
1045 | if (tp->fastopen_req != NULL) | 1045 | if (tp->fastopen_req) |
1046 | return -EALREADY; /* Another Fast Open is in progress */ | 1046 | return -EALREADY; /* Another Fast Open is in progress */ |
1047 | 1047 | ||
1048 | tp->fastopen_req = kzalloc(sizeof(struct tcp_fastopen_request), | 1048 | tp->fastopen_req = kzalloc(sizeof(struct tcp_fastopen_request), |
1049 | sk->sk_allocation); | 1049 | sk->sk_allocation); |
1050 | if (unlikely(tp->fastopen_req == NULL)) | 1050 | if (unlikely(!tp->fastopen_req)) |
1051 | return -ENOBUFS; | 1051 | return -ENOBUFS; |
1052 | tp->fastopen_req->data = msg; | 1052 | tp->fastopen_req->data = msg; |
1053 | tp->fastopen_req->size = size; | 1053 | tp->fastopen_req->size = size; |
@@ -2138,7 +2138,7 @@ adjudge_to_death: | |||
2138 | * aborted (e.g., closed with unread data) before 3WHS | 2138 | * aborted (e.g., closed with unread data) before 3WHS |
2139 | * finishes. | 2139 | * finishes. |
2140 | */ | 2140 | */ |
2141 | if (req != NULL) | 2141 | if (req) |
2142 | reqsk_fastopen_remove(sk, req, false); | 2142 | reqsk_fastopen_remove(sk, req, false); |
2143 | inet_csk_destroy_sock(sk); | 2143 | inet_csk_destroy_sock(sk); |
2144 | } | 2144 | } |
@@ -2776,7 +2776,7 @@ static int do_tcp_getsockopt(struct sock *sk, int level, | |||
2776 | break; | 2776 | break; |
2777 | 2777 | ||
2778 | case TCP_FASTOPEN: | 2778 | case TCP_FASTOPEN: |
2779 | if (icsk->icsk_accept_queue.fastopenq != NULL) | 2779 | if (icsk->icsk_accept_queue.fastopenq) |
2780 | val = icsk->icsk_accept_queue.fastopenq->max_qlen; | 2780 | val = icsk->icsk_accept_queue.fastopenq->max_qlen; |
2781 | else | 2781 | else |
2782 | val = 0; | 2782 | val = 0; |
@@ -2960,7 +2960,7 @@ void tcp_done(struct sock *sk) | |||
2960 | 2960 | ||
2961 | tcp_set_state(sk, TCP_CLOSE); | 2961 | tcp_set_state(sk, TCP_CLOSE); |
2962 | tcp_clear_xmit_timers(sk); | 2962 | tcp_clear_xmit_timers(sk); |
2963 | if (req != NULL) | 2963 | if (req) |
2964 | reqsk_fastopen_remove(sk, req, false); | 2964 | reqsk_fastopen_remove(sk, req, false); |
2965 | 2965 | ||
2966 | sk->sk_shutdown = SHUTDOWN_MASK; | 2966 | sk->sk_shutdown = SHUTDOWN_MASK; |