tcp: len check is unnecessarily devastating, change to WARN_ON

All callers are prepared for alloc failures anyway, so this error
can safely be boomeranged to the callers domain without super
bad consequences. ...At worst the connection might go into a state
where each RTO tries to (unsuccessfully) re-fragment with such
a mis-sized value and eventually dies.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Ilpo Järvinen and committed by David S. Miller 2fceec13 2cab86be

+2 -1
+2 -1
net/ipv4/tcp_output.c
··· 1003 1003 int nlen; 1004 1004 u8 flags; 1005 1005 1006 - BUG_ON(len > skb->len); 1006 + if (WARN_ON(len > skb->len)) 1007 + return -EINVAL; 1007 1008 1008 1009 nsize = skb_headlen(skb) - len; 1009 1010 if (nsize < 0)