Fix compiler warning in ftrace.c
PATCH 1/1 Fix compiler warning in ftrace.c
kernel/trace/ftrace.c: In function ‘ftrace_regex_write.clone.15’:kernel/trace/ftrace.c:2743:6: warning: ‘ret’ may be used uninitialized in this function
--- kernel/trace/ftrace.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/trace/ftrace.c +0 -0
@@ -2740,7 +2740,7 @@ static int ftrace_process_regex(struct ftrace_hash
*hash,
{
char *func, *command, *next = buff;
struct ftrace_func_command *p;- int ret;
+ int ret = -EINVAL;
func = strsep(&next, ":");
Steven Rostedt
maintainerQuoted 3 lines · GuoWen Li
kernel/trace/ftrace.c: In function ‘ftrace_regex_write.clone.15’:kernel/trace/ftrace.c:2743:6: warning: ‘ret’ may be used uninitialized in this function
Thanks, but this isn't just a fix of a warning, it fixes an actual bug.
-- Steve
Quoted 19 lines
Signed-off-by GuoWen Li--- kernel/trace/ftrace.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)kernel/trace/ftrace.c +1
-1@@ -2740,7 +2740,7 @@ static int ftrace_process_regex(struct ftrace_hash *hash, {char *func, *command, *next = buff;struct ftrace_func_command *p; -int ret; +int ret = -EINVAL ; func =strsep (&next,":" );
Steven Rostedt
maintainerCouple of things:
Quoted 5 lines · GuoWen Li
kernel/trace/ftrace.c: In function ‘ftrace_regex_write.clone.15’:kernel/trace/ftrace.c:2743:6: warning: ‘ret’ may be used uninitialized in this functionSigned-off-by GuoWen Li
Please add your mail address to your SOB. (I'll fix it)
Quoted 9 lines
--- kernel/trace/ftrace.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)kernel/trace/ftrace.c +0
-0
kernel/trace/ftrace.c static int ftrace_process_regex(struct ftrace_hash · line 2744
Quoted 6 lines
kernel/trace/ftrace.c +1
-1@@ -2740,7 +2740,7 @@ static int ftrace_process_regex(struct ftrace_hash *hash, {char *func, *command, *next = buff;struct ftrace_func_command *p; -int ret; +int ret = -EINVAL ;
This patch has horrible white space issues. (I fixed it)
-- Steve
Quoted 2 lines
kernel/trace/ftrace.c +0
-0func =strsep (&next,":" );
Thank you for pointing them out, i will be careful next time. :)
----- Original Message -----
From: "Steven Rostedt" <[email protected]>
To: "GuoWen Li" <[email protected]>
Cc: <[email protected]>
Sent: Friday, June 03, 2011 10:50 AM
Subject: Re: [PATCH] Fix compiler warning in ftrace.c
Quoted 37 lines
Couple of things:
Quoted 5 lines · GuoWen Li
kernel/trace/ftrace.c: In function ‘ftrace_regex_write.clone.15’:kernel/trace/ftrace.c:2743:6: warning: ‘ret’ may be used uninitialized in this functionSigned-off-by GuoWen LiPlease add your mail address to your SOB. (I'll fix it)
Quoted 9 lines
--- kernel/trace/ftrace.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)kernel/trace/ftrace.c +0
-0kernel/trace/ftrace.c static int ftrace_process_regex(struct ftrace_hash · line 2744
Quoted 6 lines
kernel/trace/ftrace.c +1
-1@@ -2740,7 +2740,7 @@ static int ftrace_process_regex(struct ftrace_hash *hash, {char *func, *command, *next = buff;struct ftrace_func_command *p; -int ret; +int ret = -EINVAL ;This patch has horrible white space issues. (I fixed it)
-- Steve
kernel/trace/ftrace.c static int ftrace_process_regex(struct ftrace_hash · line 2745
Quoted 2 lines
kernel/trace/ftrace.c +0
-0func =strsep (&next,":" );���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
[tip:perf/urgent] ftrace: Fix possible undefined return code
In reply to GuoWen LiCommit-ID: 0aff1c0cef13b34c17e81a502336fad738151c37 Gitweb: http://git.kernel.org/tip/0aff1c0cef13b34c17e81a502336fad738151c37 Author: GuoWen Li <[email protected]> AuthorDate: Wed, 1 Jun 2011 19:18:47 +0800 Committer: Steven Rostedt <[email protected]> CommitDate: Mon, 6 Jun 2011 22:34:25 -0400
ftrace: Fix possible undefined return code
kernel/trace/ftrace.c: In function 'ftrace_regex_write.clone.15':kernel/trace/ftrace.c:2743:6: warning: 'ret' may be used uninitialized in this function
--- kernel/trace/ftrace.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/trace/ftrace.c +1 -1
@@ -2740,7 +2740,7 @@ static int ftrace_process_regex(struct ftrace_hash *hash, {char *func, *command, *next = buff;struct ftrace_func_command *p; -int ret; +int ret = -EINVAL ; func =strsep (&next,":" );