[PATCH] ftrace: '< 0' test on unsigned

From: Roel Kluin
Date: Sun Mar 01 2009 - 15:55:53 EST


or should this be fixed, with

if (!cnt || cnt > DEFINE)

if so, what should DEFINE be?

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

Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
---
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index fdf913d..6dab415 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1129,7 +1129,7 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
size_t read = 0;
ssize_t ret;

- if (!cnt || cnt < 0)
+ if (!cnt || (ssize_t)cnt < 0)
return 0;

mutex_lock(&ftrace_regex_lock);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/