public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ftrace: unsigned idx cannot be less than 0
@ 2009-01-02 14:49 Roel Kluin
  2009-01-02 15:48 ` Frederic Weisbecker
  0 siblings, 1 reply; 7+ messages in thread
From: Roel Kluin @ 2009-01-02 14:49 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: lkml

// vi kernel/trace/ftrace.c +787
struct ftrace_iterator {
...
        unsigned                idx;
...
};

idx is unsigned and cannot be less than 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 2f32969..a344add 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -842,7 +842,7 @@ static void *t_start(struct seq_file *m, loff_t *pos)
 	void *p = NULL;
 
 	if (*pos > 0) {
-		if (iter->idx < 0)
+		if (iter->idx == 0)
 			return p;
 		(*pos)--;
 		iter->idx--;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-01-06 15:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-02 14:49 [PATCH] ftrace: unsigned idx cannot be less than 0 Roel Kluin
2009-01-02 15:48 ` Frederic Weisbecker
2009-01-02 19:20   ` Roel Kluin
2009-01-02 21:11     ` Frederic Weisbecker
2009-01-03 15:55       ` [PATCH v2] " Roel Kluin
2009-01-06 15:49   ` [PATCH] " Steven Rostedt
2009-01-06 15:58     ` Frédéric Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox