tracing: Fix minor bugs for __unregister_ftrace_function_probe
authorAtsushi Tsuji <a-tsuji@bk.jp.nec.com>
Tue, 15 Sep 2009 10:06:30 +0000 (19:06 +0900)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 16 Sep 2009 13:08:54 +0000 (09:08 -0400)
Fix the condition of strcmp for "*".
Also fix NULL pointer dereference when glob is NULL.

Signed-off-by: Atsushi Tsuji <a-tsuji@bk.jp.nec.com>
LKML-Reference: <4AAF6726.5090905@bk.jp.nec.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ftrace.c

index 8b23d56700882a265d0941fb65b64b49863e24e2..f7ab7fc162ccbbc091a64541e2e82761c528e1d2 100644 (file)
@@ -2062,9 +2062,9 @@ __unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
        int i, len = 0;
        char *search;
 
-       if (glob && (strcmp(glob, "*") || !strlen(glob)))
+       if (glob && (strcmp(glob, "*") == 0 || !strlen(glob)))
                glob = NULL;
-       else {
+       else if (glob) {
                int not;
 
                type = ftrace_setup_glob(glob, strlen(glob), &search, &not);