Skip to contentSkip to conversation

tracing: Hopefully the last updates for 4.13

PATCH New Steven Rostedt 1 participant 3 messages Jul 13, 2017

Subsystems (3)
lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH 1/2 ftrace: Remove an unneeded NULL check

In reply to Steven Rostedt

From: Dan Carpenter <[email protected]>

"func" can't be NULL and it doesn't make sense to check because we've already derefenced it.

---
 kernel/trace/ftrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ftrace.c +1 -1
index 4706f0ed193e..5fb5b40b3ae8 100644
@@ -3950,7 +3950,7 @@ static int cache_mod(struct trace_array *tr,
 				continue;
 
 			/* no func matches all */
-			if (!func || strcmp(func, "*") == 0 ||
+			if (strcmp(func, "*") == 0 ||
 			    (ftrace_mod->func &&
 			     strcmp(ftrace_mod->func, func) == 0)) {
 				ret = 0;
Signature · 1 line
2.10.2
author maintainer
#2 lore raw

PATCH 2/2 ftrace: Fix uninitialized variable in match_records()

In reply to Steven Rostedt

From: Dan Carpenter <[email protected]>

My static checker complains that if "func" is NULL then "clear_filter" is uninitialized. This seems like it could be true, although it's possible something subtle is happening that I haven't seen.

kernel/trace/ftrace.c:3844 match_records()
error: uninitialized symbol 'clear_filter'.

Fixes f0a3b154bd7 ("ftrace: Clarify code for mod command")
---
 kernel/trace/ftrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ftrace.c +1 -1
index 5fb5b40b3ae8..53f6b6401cf0 100644
@@ -3816,7 +3816,7 @@ match_records(struct ftrace_hash *hash, char *func, int len, char *mod)
 	int exclude_mod = 0;
 	int found = 0;
 	int ret;
-	int clear_filter;
+	int clear_filter = 0;
 
 	if (func) {
 		func_g.type = filter_parse_regex(func, len, &func_g.search,
Signature · 1 line
2.10.2

Steven Rostedt

author maintainer
#0 lore raw

cover tracing: Hopefully the last updates for 4.13

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
for-next

Head SHA1: 2e028c4fe12907f226b8221815f16c2486ad3aa7

Dan Carpenter (2):
ftrace: Remove an unneeded NULL check
ftrace: Fix uninitialized variable in match_records()

----

 kernel/trace/ftrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)