]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Replace typecasted void pointer in set_ftrace_filter code
authorSteven Rostedt <srostedt@redhat.com>
Thu, 9 Sep 2010 14:00:28 +0000 (10:00 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 14 Sep 2010 15:42:30 +0000 (11:42 -0400)
commit567b56e2e1ae7182943a53f61b9b4b77dd7d7107
treed2a96af23b9d6ac742725bb17aafe3d4b377cb6a
parentecc52603d44e287ea659e1a30683ba11f18f983c
tracing: Replace typecasted void pointer in set_ftrace_filter code

The set_ftrace_filter uses seq_file and reads from two lists. The
pointer returned by t_next() can either be of type struct dyn_ftrace
or struct ftrace_func_probe. If there is a bug (there was one)
the wrong pointer may be used and the reference can cause an oops.

This patch makes t_next() and friends only return the iterator structure
which now has a pointer of type struct dyn_ftrace and struct
ftrace_func_probe. The t_show() can now test if the pointer is NULL or
not and if the pointer exists, it is guaranteed to be of the correct type.

Now if there's a bug, only wrong data will be shown but not an oops.

Cc: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ftrace.c