Message ID | 20230813141900.1268-2-laoar.shao@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 0aa35162d2a1ed7ae5303b8d91f7290d3b8b9219 |
Delegated to: | BPF |
Headers | show |
Series | bpf: Fix fill_link_info and add selftest | expand |
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 7f4e8c3..166390f 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -3378,14 +3378,14 @@ static int bpf_perf_link_fill_common(const struct perf_event *event, if (!ulen ^ !uname) return -EINVAL; - if (!uname) - return 0; err = bpf_get_perf_event_info(event, &prog_id, fd_type, &buf, probe_offset, probe_addr); if (err) return err; + if (!uname) + return 0; if (buf) { len = strlen(buf); err = bpf_copy_to_user(uname, buf, ulen, len);