[tip:perf/core] tracing: Fix unsigned int compare of zero in recursion check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  d41032a83b4683481cadff84bbf8e0eafeaba830
Gitweb:     http://git.kernel.org/tip/d41032a83b4683481cadff84bbf8e0eafeaba830
Author:     Steven Rostedt <srostedt@xxxxxxxxxx>
AuthorDate: Thu, 24 Jan 2013 07:52:34 -0500
Committer:  Steven Rostedt <rostedt@xxxxxxxxxxx>
CommitDate: Thu, 24 Jan 2013 07:52:34 -0500

tracing: Fix unsigned int compare of zero in recursion check

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@xxxxxxxxxx>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
 kernel/trace/trace_functions.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 1c327ef..6011525 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -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;
 
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux