Skip to content

Commit

Permalink
tcp: '< 0' test on unsigned
Browse files Browse the repository at this point in the history
promote 'cnt' to size_t, to match 'len'.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Roel Kluin authored and David S. Miller committed Mar 13, 2009
1 parent 8db09f2 commit a2025b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/ipv4/tcp_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@ static int tcpprobe_sprint(char *tbuf, int n)
static ssize_t tcpprobe_read(struct file *file, char __user *buf,
size_t len, loff_t *ppos)
{
int error = 0, cnt = 0;
int error = 0;
size_t cnt = 0;

if (!buf || len < 0)
if (!buf)
return -EINVAL;

while (cnt < len) {
Expand Down

0 comments on commit a2025b8

Please sign in to comment.