Skip to content

Commit

Permalink
tracing: Fix unsigned int compare of zero in recursion check
Browse files Browse the repository at this point in the history
Dan's smatch found a compare bug with the result of the
trace_test_and_set_recursion() and comparing to less than
zero. If the function fails, it returns -1, but was saved in
an unsigned int, which will never be less than zero and will
ignore the result of the test if a recursion did happen.

Luckily this is the last of the recursion tests, as the
infrastructure of ftrace would catch recursions before it
got here, except for some few exceptions.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Jan 24, 2013
1 parent 0b07436 commit d41032a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function_trace_call(unsigned long ip, unsigned long parent_ip,
struct trace_array *tr = func_trace;
struct trace_array_cpu *data;
unsigned long flags;
unsigned int bit;
int bit;
int cpu;
int pc;

Expand Down

0 comments on commit d41032a

Please sign in to comment.