Skip to content

Commit 906695e

Browse files
Qiujun Huangrostedt
authored andcommitted
tracing: Fix the checking of stackidx in __ftrace_trace_stack
The array size is FTRACE_KSTACK_NESTING, so the index FTRACE_KSTACK_NESTING is illegal too. And fix two typos by the way. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Qiujun Huang <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 726b3d3 commit 906695e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/trace/trace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2750,7 +2750,7 @@ trace_event_buffer_lock_reserve(struct trace_buffer **current_rb,
27502750
/*
27512751
* If tracing is off, but we have triggers enabled
27522752
* we still need to look at the event data. Use the temp_buffer
2753-
* to store the trace event for the tigger to use. It's recusive
2753+
* to store the trace event for the trigger to use. It's recursive
27542754
* safe and will not be recorded anywhere.
27552755
*/
27562756
if (!entry && trace_file->flags & EVENT_FILE_FL_TRIGGER_COND) {
@@ -2952,7 +2952,7 @@ static void __ftrace_trace_stack(struct trace_buffer *buffer,
29522952
stackidx = __this_cpu_inc_return(ftrace_stack_reserve) - 1;
29532953

29542954
/* This should never happen. If it does, yell once and skip */
2955-
if (WARN_ON_ONCE(stackidx > FTRACE_KSTACK_NESTING))
2955+
if (WARN_ON_ONCE(stackidx >= FTRACE_KSTACK_NESTING))
29562956
goto out;
29572957

29582958
/*

0 commit comments

Comments
 (0)