Skip to content

Commit 692cfff

Browse files
nathanchancegregkh
authored andcommitted
tracing/probes: Avoid using params uninitialized in parse_btf_arg()
commit 1ed171a upstream. After a recent change in clang to strengthen uninitialized warnings [1], it points out that in one of the error paths in parse_btf_arg(), params is used uninitialized: kernel/trace/trace_probe.c:660:19: warning: variable 'params' is uninitialized when used here [-Wuninitialized] 660 | return PTR_ERR(params); | ^~~~~~ Match many other NO_BTF_ENTRY error cases and return -ENOENT, clearing up the warning. Link: https://lore.kernel.org/all/20250715-trace_probe-fix-const-uninit-warning-v1-1-98960f91dd04@kernel.org/ Cc: stable@vger.kernel.org Closes: ClangBuiltLinux/linux#2110 Fixes: d157d76 ("tracing/probes: Support BTF field access from $retval") Link: llvm/llvm-project@2464313 [1] Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d18f63e commit 692cfff

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
@@ -657,7 +657,7 @@ static int parse_btf_arg(char *varname,
657657
ret = query_btf_context(ctx);
658658
if (ret < 0 || ctx->nr_params == 0) {
659659
trace_probe_log_err(ctx->offset, NO_BTF_ENTRY);
660-
return PTR_ERR(params);
660+
return -ENOENT;
661661
}
662662
}
663663
params = ctx->params;

0 commit comments

Comments
 (0)