From: Roel Kluin <roel.kluin@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] ftrace: '< 0' test on unsigned
Date: Sun, 01 Mar 2009 21:55:42 +0100 [thread overview]
Message-ID: <49AAF64E.9070205@gmail.com> (raw)
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@gmail.com>
---
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);
next reply other threads:[~2009-03-01 20:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-01 20:55 Roel Kluin [this message]
2009-03-01 21:14 ` [PATCH] ftrace: '< 0' test on unsigned Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49AAF64E.9070205@gmail.com \
--to=roel.kluin@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox