[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0903011613000.4771@gandalf.stny.rr.com>
Date: Sun, 1 Mar 2009 16:14:29 -0500 (EST)
From: Steven Rostedt <rostedt@...dmis.org>
To: Roel Kluin <roel.kluin@...il.com>
cc: lkml <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] ftrace: '< 0' test on unsigned
On Sun, 1 Mar 2009, Roel Kluin wrote:
> or should this be fixed, with
>
> if (!cnt || cnt > DEFINE)
>
> if so, what should DEFINE be?
Hi Roel,
Thanks, but I already put in the fix for this. Since Andrew pointed out
that cnt was unsigned in my "cut and paste" from this function. I went
back and fixed it. There should be no DEFINE. cnt can never be less than
zero, so simply checking for (!cnt) is sufficient.
-- Steve
>
> 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@...il.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);
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists