Commit 374e7b59 authored by Octavian Purdila's avatar Octavian Purdila Committed by David S. Miller

tcp: fix a size_t < 0 comparison in tcp_read_sock

<used> should be of type int (not size_t) since recv_actor can return
negative values and it is also used in a < 0 comparison.
Signed-off-by: default avatarOctavian Purdila <opurdila@ixiacom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 81b23b4a
...@@ -1209,7 +1209,8 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, ...@@ -1209,7 +1209,8 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
return -ENOTCONN; return -ENOTCONN;
while ((skb = tcp_recv_skb(sk, seq, &offset)) != NULL) { while ((skb = tcp_recv_skb(sk, seq, &offset)) != NULL) {
if (offset < skb->len) { if (offset < skb->len) {
size_t used, len; int used;
size_t len;
len = skb->len - offset; len = skb->len - offset;
/* Stop reading if we hit a patch of urgent data */ /* Stop reading if we hit a patch of urgent data */
......
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