>From 8a8e438947d1dd0848cedcaacaf956387184300f Mon Sep 17 00:00:00 2001 From: Octavian Purdila Date: Sun, 1 Jun 2008 21:39:48 +0300 Subject: [PATCH] tcp_read_sock: fix a size_t < 0 comparison 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: Octavian Purdila --- net/ipv4/tcp.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 680546a..78c66b6 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1206,7 +1206,8 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, return -ENOTCONN; while ((skb = tcp_recv_skb(sk, seq, &offset)) != NULL) { if (offset < skb->len) { - size_t used, len; + int used; + size_t len; len = skb->len - offset; /* Stop reading if we hit a patch of urgent data */ -- 1.5.4.3