aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/af_inet.c7
-rw-r--r--net/ipv4/inet_connection_sock.c4
2 files changed, 4 insertions, 7 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 4f70ef0b946d..845372b025f6 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -149,11 +149,8 @@ void inet_sock_destruct(struct sock *sk)
149 pr_err("Attempt to release alive inet socket %p\n", sk); 149 pr_err("Attempt to release alive inet socket %p\n", sk);
150 return; 150 return;
151 } 151 }
152 if (sk->sk_type == SOCK_STREAM) { 152 if (sk->sk_protocol == IPPROTO_TCP)
153 struct fastopen_queue *fastopenq = 153 kfree(inet_csk(sk)->icsk_accept_queue.fastopenq);
154 inet_csk(sk)->icsk_accept_queue.fastopenq;
155 kfree(fastopenq);
156 }
157 154
158 WARN_ON(atomic_read(&sk->sk_rmem_alloc)); 155 WARN_ON(atomic_read(&sk->sk_rmem_alloc));
159 WARN_ON(atomic_read(&sk->sk_wmem_alloc)); 156 WARN_ON(atomic_read(&sk->sk_wmem_alloc));
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 8464b79c493f..f0c5b9c1a957 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -314,7 +314,7 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err)
314 newsk = req->sk; 314 newsk = req->sk;
315 315
316 sk_acceptq_removed(sk); 316 sk_acceptq_removed(sk);
317 if (sk->sk_type == SOCK_STREAM && queue->fastopenq != NULL) { 317 if (sk->sk_protocol == IPPROTO_TCP && queue->fastopenq != NULL) {
318 spin_lock_bh(&queue->fastopenq->lock); 318 spin_lock_bh(&queue->fastopenq->lock);
319 if (tcp_rsk(req)->listener) { 319 if (tcp_rsk(req)->listener) {
320 /* We are still waiting for the final ACK from 3WHS 320 /* We are still waiting for the final ACK from 3WHS
@@ -775,7 +775,7 @@ void inet_csk_listen_stop(struct sock *sk)
775 775
776 percpu_counter_inc(sk->sk_prot->orphan_count); 776 percpu_counter_inc(sk->sk_prot->orphan_count);
777 777
778 if (sk->sk_type == SOCK_STREAM && tcp_rsk(req)->listener) { 778 if (sk->sk_protocol == IPPROTO_TCP && tcp_rsk(req)->listener) {
779 BUG_ON(tcp_sk(child)->fastopen_rsk != req); 779 BUG_ON(tcp_sk(child)->fastopen_rsk != req);
780 BUG_ON(sk != tcp_rsk(req)->listener); 780 BUG_ON(sk != tcp_rsk(req)->listener);
781 781