lkml.org 
[lkml]   [2017]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/2] ftrace: silence uninitialized variable warning
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'.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
It does occur to me that I could initialize it to 1 instead of 0 but my
guess is that zero is intended. Please review this one carefully.

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 2a3c45743f54..5e658da91912 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,
\
 
 \ /
  Last update: 2017-07-12 09:36    [W:0.056 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site