提交 a1303479 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

tools lib traceevent: Fix kbuffer_read_at_offset()

When it's called with an offset less than or equal to the first event,
it'll return a garbage value since the data is not initialized.
Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
Acked-by: NSteven Rostedt <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20161001101700.29146-1-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 3bccbe20
......@@ -622,6 +622,7 @@ void *kbuffer_read_at_offset(struct kbuffer *kbuf, int offset,
/* Reset the buffer */
kbuffer_load_subbuffer(kbuf, kbuf->subbuffer);
data = kbuffer_read_event(kbuf, ts);
while (kbuf->curr < offset) {
data = kbuffer_next_event(kbuf, ts);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册