summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorOctavian Purdila <opurdila@ixiacom.com>2008-07-03 03:31:21 -0700
committerDavid S. Miller <davem@davemloft.net>2008-07-03 03:31:21 -0700
commit374e7b59498ce0785b3727794b351221528a5159 (patch)
treedca488eae546ff8a113e614670e23460a23dc7ea /net/ipv4/tcp.c
parent81b23b4a7acd9b37a269c62d02479d4f645dd20a (diff)
downloadop-kernel-dev-374e7b59498ce0785b3727794b351221528a5159.zip
op-kernel-dev-374e7b59498ce0785b3727794b351221528a5159.tar.gz
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: Octavian Purdila <opurdila@ixiacom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index de53024..1d723de1 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1209,7 +1209,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 */
OpenPOWER on IntegriCloud