public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [for-next][PATCH 0/2] tracing: Hopefully the last updates for 4.13
@ 2017-07-13  1:07 Steven Rostedt
  2017-07-13  1:07 ` [for-next][PATCH 1/2] ftrace: Remove an unneeded NULL check Steven Rostedt
  2017-07-13  1:07 ` [for-next][PATCH 2/2] ftrace: Fix uninitialized variable in match_records() Steven Rostedt
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2017-07-13  1:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton

  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(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [for-next][PATCH 1/2] ftrace: Remove an unneeded NULL check
  2017-07-13  1:07 [for-next][PATCH 0/2] tracing: Hopefully the last updates for 4.13 Steven Rostedt
@ 2017-07-13  1:07 ` Steven Rostedt
  2017-07-13  1:07 ` [for-next][PATCH 2/2] ftrace: Fix uninitialized variable in match_records() Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2017-07-13  1:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Dan Carpenter

[-- Attachment #1: 0001-ftrace-Remove-an-unneeded-NULL-check.patch --]
[-- Type: text/plain, Size: 861 bytes --]

From: Dan Carpenter <dan.carpenter@oracle.com>

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

Link: http://lkml.kernel.org/r/20170712073340.4enzeojeoupuds5a@mwanda

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 4706f0ed193e..5fb5b40b3ae8 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -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;
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [for-next][PATCH 2/2] ftrace: Fix uninitialized variable in match_records()
  2017-07-13  1:07 [for-next][PATCH 0/2] tracing: Hopefully the last updates for 4.13 Steven Rostedt
  2017-07-13  1:07 ` [for-next][PATCH 1/2] ftrace: Remove an unneeded NULL check Steven Rostedt
@ 2017-07-13  1:07 ` Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2017-07-13  1:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, stable, Dan Carpenter

[-- Attachment #1: 0002-ftrace-Fix-uninitialized-variable-in-match_records.patch --]
[-- Type: text/plain, Size: 1134 bytes --]

From: Dan Carpenter <dan.carpenter@oracle.com>

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'.

Link: http://lkml.kernel.org/r/20170712073556.h6tkpjcdzjaozozs@mwanda

Cc: stable@vger.kernel.org
Fixes: f0a3b154bd7 ("ftrace: Clarify code for mod command")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 5fb5b40b3ae8..53f6b6401cf0 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -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,
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-13  1:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-13  1:07 [for-next][PATCH 0/2] tracing: Hopefully the last updates for 4.13 Steven Rostedt
2017-07-13  1:07 ` [for-next][PATCH 1/2] ftrace: Remove an unneeded NULL check Steven Rostedt
2017-07-13  1:07 ` [for-next][PATCH 2/2] ftrace: Fix uninitialized variable in match_records() Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox