[PATCH 1/4] ftrace: Simplify glob handling in unregister_ftrace_function_probe_func()

Naveen N. Rao
2017-05-13T19:33:06Z

Handle a NULL glob properly.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
kernel/trace/ftrace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 39dca4e86a94..28dc824ad072 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -4144,9 +4144,9 @@ unregister_ftrace_function_probe_func(char *glob, struct trace_array *tr,
int i, ret = -ENODEV;
int size;

- if (glob && (strcmp(glob, "*") == 0 || !strlen(glob)))
+ if (!glob || (glob && (strcmp(glob, "*") == 0 || !strlen(glob))))
func_g.search = NULL;
- else if (glob) {
+ else {
int not;

func_g.type = filter_parse_regex(glob, strlen(glob),
--
2.12.2