The tcp_retransmit_timer() function checks if tcp_retransmit_skb() returns a value greater than 0, but tcp_retransmit_skb() returns 0 on success and negative error codes on failure. This means the error handling branch is never executed when retransmission fails. Fix this by changing the condition to check for != 0 instead of > 0. Signed-off-by: Liu Congcong --- net/ipv4/tcp_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 160080c9021d..4fbb387e7e7b 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -624,7 +624,7 @@ void tcp_retransmit_timer(struct sock *sk) tcp_enter_loss(sk); tcp_update_rto_stats(sk); - if (tcp_retransmit_skb(sk, tcp_rtx_queue_head(sk), 1) > 0) { + if (tcp_retransmit_skb(sk, tcp_rtx_queue_head(sk), 1)) { /* Retransmission failed because of local congestion, * Let senders fight for local resources conservatively. */ -- 2.17.0