mptcp: Fix unsigned 'max_seq' compared with zero in mptcp_data_queue_ofo

Fixes coccicheck warnig:
net/mptcp/protocol.c:164:11-18: WARNING: Unsigned expression compared with zero: max_seq > 0

Fixes: ab174ad8ef ("mptcp: move ooo skbs into msk out of order queue")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ye Bin 2020-09-17 09:12:33 +08:00 committed by David S. Miller
parent 3ce406bda0
commit c2ec6bc010
1 changed files with 3 additions and 2 deletions

View File

@ -157,11 +157,12 @@ static void mptcp_data_queue_ofo(struct mptcp_sock *msk, struct sk_buff *skb)
struct rb_node **p, *parent;
u64 seq, end_seq, max_seq;
struct sk_buff *skb1;
int space;
seq = MPTCP_SKB_CB(skb)->map_seq;
end_seq = MPTCP_SKB_CB(skb)->end_seq;
max_seq = tcp_space(sk);
max_seq = max_seq > 0 ? max_seq + msk->ack_seq : msk->ack_seq;
space = tcp_space(sk);
max_seq = space > 0 ? space + msk->ack_seq : msk->ack_seq;
pr_debug("msk=%p seq=%llx limit=%llx empty=%d", msk, seq, max_seq,
RB_EMPTY_ROOT(&msk->out_of_order_queue));