ftrace: fix setting of pos in read_pipe
authorSteven Rostedt <rostedt@goodmis.org>
Mon, 12 May 2008 19:21:01 +0000 (21:21 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 23 May 2008 19:57:01 +0000 (21:57 +0200)
In resetting the iterator in read_pipe, the reset of pos was
postitioned in the wrong location with respect to the memset
operation. The current code sets pos, incorrectly, to zero.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/trace/trace.c

index 32f9106..49e1663 100644 (file)
@@ -2455,10 +2455,10 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
                cnt = PAGE_SIZE - 1;
 
        /* reset all but tr, trace, and overruns */
-       iter->pos = -1;
        memset(&iter->seq, 0,
               sizeof(struct trace_iterator) -
               offsetof(struct trace_iterator, seq));
+       iter->pos = -1;
 
        /*
         * We need to stop all tracing on all CPUS to read the