Skip to content

Commit

Permalink
tcp: fix a size_t < 0 comparison in tcp_read_sock
Browse files Browse the repository at this point in the history
<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>
  • Loading branch information
Octavian Purdila authored and David S. Miller committed Jul 3, 2008
1 parent 81b23b4 commit 374e7b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 374e7b5

Please sign in to comment.