Skip to content

Commit 0add699

Browse files
committed
tracing: probes: Fix to zero initialize a local variable
Fix to initialize 'val' local variable with zero. Dan reported that Smatch static code checker reports an error that a local 'val' variable needs to be initialized. Actually, the 'val' is expected to be initialized by FETCH_OP_ARG in the same loop, but it is not obvious. So initialize it with zero. Link: https://lore.kernel.org/all/171092223833.237219.17304490075697026697.stgit@devnote2/ Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Fixes: 25f00e4 ("tracing/probes: Support $argN in return probe (kprobe and fprobe)") Reviewed-by: Steven Rostedt (Google) <[email protected]> Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
1 parent e8c32f2 commit 0add699

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace_probe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ int traceprobe_get_entry_data_size(struct trace_probe *tp)
839839
void store_trace_entry_data(void *edata, struct trace_probe *tp, struct pt_regs *regs)
840840
{
841841
struct probe_entry_arg *earg = tp->entry_arg;
842-
unsigned long val;
842+
unsigned long val = 0;
843843
int i;
844844

845845
if (!earg)

0 commit comments

Comments
 (0)