Skip to content

Commit

Permalink
tracing: Fix minor bugs for __unregister_ftrace_function_probe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Atsushi Tsuji authored and Steven Rostedt committed Sep 16, 2009
1 parent fe832a3 commit b36461d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b36461d

Please sign in to comment.