]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
tracing: Fix unsigned int compare of zero in recursion check
authorSteven Rostedt <srostedt@redhat.com>
Thu, 24 Jan 2013 12:52:34 +0000 (07:52 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 24 Jan 2013 12:52:34 +0000 (07:52 -0500)
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>
kernel/trace/trace_functions.c

index 1c327ef13a9aa799475e34038722d16757f7a5d8..60115252332668f2b39c4c868304b9187017b879 100644 (file)
@@ -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;