aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_timer.c
diff options
context:
space:
mode:
authorYuchung Cheng <ycheng@google.com>2019-01-16 18:05:28 -0500
committerDavid S. Miller <davem@davemloft.net>2019-01-17 18:12:26 -0500
commit88f8598d0a302a08380eadefd09b9f5cb1c4c428 (patch)
treef31cbddb0cc70e708a7c6e27107410fd47685a49 /net/ipv4/tcp_timer.c
parent9b420eff9fcf69a85034c1e657a861de575c96e1 (diff)
tcp: exit if nothing to retransmit on RTO timeout
Previously TCP only warns if its RTO timer fires and the retransmission queue is empty, but it'll cause null pointer reference later on. It's better to avoid such catastrophic failure and simply exit with a warning. Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Neal Cardwell <ncardwell@google.com> Reviewed-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r--net/ipv4/tcp_timer.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 71a29e9c0620..e7d09e3705b8 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -443,10 +443,8 @@ void tcp_retransmit_timer(struct sock *sk)
443 */ 443 */
444 return; 444 return;
445 } 445 }
446 if (!tp->packets_out) 446 if (!tp->packets_out || WARN_ON_ONCE(tcp_rtx_queue_empty(sk)))
447 goto out; 447 return;
448
449 WARN_ON(tcp_rtx_queue_empty(sk));
450 448
451 tp->tlp_high_seq = 0; 449 tp->tlp_high_seq = 0;
452 450