Skip to content

Commit 75202d3

Browse files
Dan Carpentergregkh
authored andcommitted
ftrace: Fix uninitialized variable in match_records()
commit 2e028c4fe12907f226b8221815f16c2486ad3aa7 upstream. My static checker complains that if "func" is NULL then "clear_filter" is uninitialized. This seems like it could be true, although it's possible something subtle is happening that I haven't seen. kernel/trace/ftrace.c:3844 match_records() error: uninitialized symbol 'clear_filter'. Link: http://lkml.kernel.org/r/20170712073556.h6tkpjcdzjaozozs@mwanda Fixes: f0a3b15 ("ftrace: Clarify code for mod command") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3457c04 commit 75202d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/trace/ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3535,7 +3535,7 @@ match_records(struct ftrace_hash *hash, char *func, int len, char *mod)
35353535
int exclude_mod = 0;
35363536
int found = 0;
35373537
int ret;
3538-
int clear_filter;
3538+
int clear_filter = 0;
35393539

35403540
if (func) {
35413541
func_g.type = filter_parse_regex(func, len, &func_g.search,

0 commit comments

Comments
 (0)