Message ID | 20220417183432.3952871-1-eric.dumazet@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 843f77407eebee07c2a3300df0c4b33f64322e29 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v2,net-next] tcp: fix signed/unsigned comparison | expand |
Hello: This patch was applied to netdev/net-next.git (master) by David S. Miller <davem@davemloft.net>: On Sun, 17 Apr 2022 11:34:32 -0700 you wrote: > From: Eric Dumazet <edumazet@google.com> > > Kernel test robot reported: > > smatch warnings: > net/ipv4/tcp_input.c:5966 tcp_rcv_established() warn: unsigned 'reason' is never less than zero. > > [...] Here is the summary with links: - [v2,net-next] tcp: fix signed/unsigned comparison https://git.kernel.org/netdev/net-next/c/843f77407eeb You are awesome, thank you!
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index cf2dc19bb8c766c1d33406053fd61c0873f15489..daff631b94865ae95cbd49ed8ecf6782edaf16e7 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -5959,9 +5959,10 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) step5: reason = tcp_ack(sk, skb, FLAG_SLOWPATH | FLAG_UPDATE_TS_RECENT); - if (reason < 0) + if ((int)reason < 0) { + reason = -reason; goto discard; - + } tcp_rcv_rtt_measure_ts(sk, skb); /* Process urgent data. */