Commit 0aa3516
bpf: Fix uninitialized symbol in bpf_perf_link_fill_kprobe()
The commit 1b715e1 ("bpf: Support ->fill_link_info for perf_event") leads
to the following Smatch static checker warning:
kernel/bpf/syscall.c:3416 bpf_perf_link_fill_kprobe()
error: uninitialized symbol 'type'.
That can happens when uname is NULL. So fix it by verifying the uname when we
really need to fill it.
Fixes: 1b715e1 ("bpf: Support ->fill_link_info for perf_event")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Closes: https://lore.kernel.org/bpf/85697a7e-f897-4f74-8b43-82721bebc462@kili.mountain
Link: https://lore.kernel.org/bpf/20230813141900.1268-2-laoar.shao@gmail.com1 parent 8897562 commit 0aa3516
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3378 | 3378 | | |
3379 | 3379 | | |
3380 | 3380 | | |
3381 | | - | |
3382 | | - | |
3383 | 3381 | | |
3384 | 3382 | | |
3385 | 3383 | | |
3386 | 3384 | | |
3387 | 3385 | | |
3388 | | - | |
| 3386 | + | |
| 3387 | + | |
3389 | 3388 | | |
3390 | 3389 | | |
3391 | 3390 | | |
| |||
0 commit comments