This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH 1/2] tracing: Fix minor bugs for __unregister_ftrace_function_probe
- From: Atsushi Tsuji <a-tsuji at bk dot jp dot nec dot com>
- To: linux-kernel at vger dot kernel dot org, rostedt at goodmis dot org, Ingo Molnar <mingo at elte dot hu>, fweisbec at gmail dot com, "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: Peter Zijlstra <peterz at infradead dot org>, paulus at samba dot org, systemtap at sources dot redhat dot com
- Date: Tue, 15 Sep 2009 19:06:30 +0900
- Subject: [PATCH 1/2] tracing: Fix minor bugs for __unregister_ftrace_function_probe
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>
---
kernel/trace/ftrace.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 8c804e2..5ef8f59 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2059,9 +2059,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, ¬);
--
1.5.5.1