Subject: [PATCH] tcp: '< 0' test on unsigned

From: Roel Kluin <[email-masked]>
Date: Sun, 01 Mar 2009 22:09:29 +0100

or should this be fixed, with

        if (!buf || len > x)

if so, what should x be?

This patch wasn't tested in any way.
------------------------------>8-------------8<---------------------------------
len is unsigned, so the '< 0' test won't work.

Signed-off-by: Roel Kluin <[email-masked]>
---
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 25524d4..0b9d63f 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -167,7 +167,7 @@ static ssize_t tcpprobe_read(struct file *file, char __user *buf,
 {
 	int error = 0, cnt = 0;
 
-	if (!buf || len < 0)
+	if (!buf || (ssize_t)len < 0)
 		return -EINVAL;
 
 	while (cnt < len) {