]> Git Repo - J-linux.git/commitdiff
tracing: probes: Fix to zero initialize a local variable
authorMasami Hiramatsu (Google) <[email protected]>
Wed, 20 Mar 2024 08:10:38 +0000 (17:10 +0900)
committerMasami Hiramatsu (Google) <[email protected]>
Mon, 25 Mar 2024 07:24:31 +0000 (16:24 +0900)
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: 25f00e40ce79 ("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]>
kernel/trace/trace_probe.c

index 217169de0920ed93778ea93e7995a0863c097ef7..dfe3ee6035ecc74da70ebd8104d23f1ef2a25cde 100644 (file)
@@ -839,7 +839,7 @@ out:
 void store_trace_entry_data(void *edata, struct trace_probe *tp, struct pt_regs *regs)
 {
        struct probe_entry_arg *earg = tp->entry_arg;
-       unsigned long val;
+       unsigned long val = 0;
        int i;
 
        if (!earg)
This page took 0.05496 seconds and 4 git commands to generate.