]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ftrace: Fix uninitialized variable in match_records()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 12 Jul 2017 07:35:57 +0000 (10:35 +0300)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 12 Jul 2017 13:48:31 +0000 (09:48 -0400)
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
Cc: stable@vger.kernel.org
Fixes: f0a3b154bd7 ("ftrace: Clarify code for mod command")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/ftrace.c

index 5fb5b40b3ae8dfd03a19350113dc547ea5fcb9a8..53f6b6401cf05fe9d63be0b67d646d25eed929e7 100644 (file)
@@ -3816,7 +3816,7 @@ match_records(struct ftrace_hash *hash, char *func, int len, char *mod)
        int exclude_mod = 0;
        int found = 0;
        int ret;
-       int clear_filter;
+       int clear_filter = 0;
 
        if (func) {
                func_g.type = filter_parse_regex(func, len, &func_g.search,