]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Quiet gcc warning about maybe unused link variable
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 26 Jul 2018 02:28:56 +0000 (22:28 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 26 Jul 2018 02:33:50 +0000 (22:33 -0400)
commit21fb9bef0816b23fbfcfe84ad4df9a9dc8d1b0c8
tree6d60632f0a1cbd4fb9a9c79462e6a0887bd4c19a
parent661c3dad664c644efd3d95e1be74b4042b71beea
tracing: Quiet gcc warning about maybe unused link variable

Commit 4d244a0ce7d0 ("tracing/kprobes: Fix trace_probe flags on
enable_trace_kprobe() failure") added an if statement that depends on another
if statement that gcc doesn't see will initialize the "link" variable and
gives the warning:

 "warning: 'link' may be used uninitialized in this function"

It is really a false positive, but to quiet the warning, and also to make
sure that it never actually is used uninitialized, initialize the "link"
variable to NULL and add an if (!WARN_ON_ONCE(!link)) where the compiler
thinks it could be used uninitialized.

Cc: stable@vger.kernel.org
Fixes: 4d244a0ce7d0 ("tracing/kprobes: Fix trace_probe flags on enable_trace_kprobe() failure")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_kprobe.c