Commit 38ceade
libbpf: avoid possible use of uninitialized mod_len
If not fn_name, mod_len does never get initialized which fails now with
gcc15 on Alpine Linux edge:
libbpf.c: In function 'find_kernel_btf_id.constprop':
libbpf.c:10100:33: error: 'mod_len' may be used uninitialized [-Werror=maybe-uninitialized]
10100 | if (mod_name && strncmp(mod->name, mod_name, mod_len) != 0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libbpf.c:10070:21: note: 'mod_len' was declared here
10070 | int ret, i, mod_len;
| ^~~~~~~
Fixes: 8f8a024 ("libbpf: support "module: Function" syntax for tracing programs")
Signed-off-by: Achill Gilgenast <[email protected]>
Acked-by: Yonghong Song <[email protected]>1 parent 6217ef6 commit 38ceade
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10096 | 10096 | | |
10097 | 10097 | | |
10098 | 10098 | | |
10099 | | - | |
| 10099 | + | |
10100 | 10100 | | |
10101 | 10101 | | |
10102 | 10102 | | |
| |||
0 commit comments