From: Eric Dumazet Date: Mon, 14 Nov 2011 10:56:56 +0000 (+0000) Subject: tcp: clear xmit timers in tcp_v4_syn_recv_sock() X-Git-Tag: MMI-PSA29.97-13-9~17993^2~29 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=709e8697af1c86772c1a6fccda6d4b0e2e226547;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git tcp: clear xmit timers in tcp_v4_syn_recv_sock() Simon Kirby reported divides by zero errors in __tcp_select_window() This happens when inet_csk_route_child_sock() returns a NULL pointer : We free new socket while we eventually armed keepalive timer in tcp_create_openreq_child() Fix this by a call to tcp_clear_xmit_timers() [ This is a followup to commit 918eb39962dff (net: add missing bh_unlock_sock() calls) ] Reported-by: Simon Kirby Signed-off-by: Eric Dumazet Tested-by: Simon Kirby Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index a7443159c400..a9db4b1a2215 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1510,6 +1510,7 @@ exit: NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); return NULL; put_and_exit: + tcp_clear_xmit_timers(newsk); bh_unlock_sock(newsk); sock_put(newsk); goto exit;