From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22028 invoked by alias); 15 Sep 2009 10:09:45 -0000 Received: (qmail 22011 invoked by uid 22791); 15 Sep 2009 10:09:43 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from TYO201.gate.nec.co.jp (HELO tyo201.gate.nec.co.jp) (202.32.8.193) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Sep 2009 10:09:36 +0000 Received: from mailgate3.nec.co.jp ([10.7.69.195]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n8FA8VJp013512; Tue, 15 Sep 2009 19:08:31 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id n8FA8V311589; Tue, 15 Sep 2009 19:08:31 +0900 (JST) Received: from mail02.kamome.nec.co.jp (mail02.kamome.nec.co.jp [10.25.43.5]) by mailsv.nec.co.jp (8.13.8/8.13.4) with ESMTP id n8FA8UPh020016; Tue, 15 Sep 2009 19:08:31 +0900 (JST) Received: from monta.jp.nec.com ([10.26.220.14] [10.26.220.14]) by mail03.kamome.nec.co.jp with ESMTP id BT-MMP-1968120; Tue, 15 Sep 2009 19:06:31 +0900 Received: from [10.34.125.240] ([10.34.125.240] [10.34.125.240]) by mail.jp.nec.com with ESMTP; Tue, 15 Sep 2009 19:06:31 +0900 Message-ID: <4AAF6726.5090905@bk.jp.nec.com> Date: Tue, 15 Sep 2009 10:09:00 -0000 From: Atsushi Tsuji User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, rostedt@goodmis.org, Ingo Molnar , fweisbec@gmail.com, "Frank Ch. Eigler" CC: Peter Zijlstra , paulus@samba.org, systemtap@sources.redhat.com Subject: [PATCH 1/2] tracing: Fix minor bugs for __unregister_ftrace_function_probe Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00724.txt.bz2 Fix the condition of strcmp for "*". Also fix NULL pointer dereference when glob is NULL. Signed-off-by: Atsushi Tsuji --- 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