tcp: Split BUG_ON() in tcp_tso_should_defer() into two assertions
authorStefano Brivio <sbrivio@redhat.com>
Thu, 4 Jan 2018 23:38:05 +0000 (00:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Jan 2018 19:12:26 +0000 (14:12 -0500)
The two conditions triggering BUG_ON() are somewhat unrelated:
the tcp_skb_pcount() check is meant to catch TSO flaws, the
second one checks sanity of congestion window bookkeeping.

Split them into two separate BUG_ON() assertions on two lines,
so that we know which one actually triggers, when they do.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c

index 04be9f833927bf67e778eaf98235266b75f0e73e..95461f02ac9a2ab9a3fdf29b1570d1e75e605244 100644 (file)
@@ -1944,7 +1944,8 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
 
        in_flight = tcp_packets_in_flight(tp);
 
-       BUG_ON(tcp_skb_pcount(skb) <= 1 || (tp->snd_cwnd <= in_flight));
+       BUG_ON(tcp_skb_pcount(skb) <= 1);
+       BUG_ON(tp->snd_cwnd <= in_flight);
 
        send_win = tcp_wnd_end(tp) - TCP_SKB_CB(skb)->seq;