Commit c2ec6bc0 authored by Ye Bin's avatar Ye Bin Committed by David S. Miller

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: ab174ad8 ("mptcp: move ooo skbs into msk out of order queue")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYe Bin <yebin10@huawei.com>
Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3ce406bd
...@@ -157,11 +157,12 @@ static void mptcp_data_queue_ofo(struct mptcp_sock *msk, struct sk_buff *skb) ...@@ -157,11 +157,12 @@ static void mptcp_data_queue_ofo(struct mptcp_sock *msk, struct sk_buff *skb)
struct rb_node **p, *parent; struct rb_node **p, *parent;
u64 seq, end_seq, max_seq; u64 seq, end_seq, max_seq;
struct sk_buff *skb1; struct sk_buff *skb1;
int space;
seq = MPTCP_SKB_CB(skb)->map_seq; seq = MPTCP_SKB_CB(skb)->map_seq;
end_seq = MPTCP_SKB_CB(skb)->end_seq; end_seq = MPTCP_SKB_CB(skb)->end_seq;
max_seq = tcp_space(sk); space = tcp_space(sk);
max_seq = max_seq > 0 ? max_seq + msk->ack_seq : msk->ack_seq; 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, pr_debug("msk=%p seq=%llx limit=%llx empty=%d", msk, seq, max_seq,
RB_EMPTY_ROOT(&msk->out_of_order_queue)); RB_EMPTY_ROOT(&msk->out_of_order_queue));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment