diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-05 08:56:10 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-05 08:56:10 +0200 |
commit | de800f290dfaa341f22acac22bc454ea2bbf8f71 (patch) | |
tree | 02ac02009524e4a8a4c1b169583618690bdd2567 /tools/perf/util/bpf-event.c | |
parent | usb: xhci-mtk: support quirk to disable usb2 lpm (diff) | |
parent | Linux 5.12-rc6 (diff) | |
download | linux-de800f290dfaa341f22acac22bc454ea2bbf8f71.tar.xz linux-de800f290dfaa341f22acac22bc454ea2bbf8f71.zip |
Merge 5.12-rc6 into usb-next
We want the USB fixes in here as well and it resolves a merge issue with
xhci-mtk.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/util/bpf-event.c')
-rw-r--r-- | tools/perf/util/bpf-event.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c index 57d58c81a5f8..cdecda1ddd36 100644 --- a/tools/perf/util/bpf-event.c +++ b/tools/perf/util/bpf-event.c @@ -196,25 +196,32 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session, } if (info_linear->info_len < offsetof(struct bpf_prog_info, prog_tags)) { + free(info_linear); pr_debug("%s: the kernel is too old, aborting\n", __func__); return -2; } info = &info_linear->info; + if (!info->jited_ksyms) { + free(info_linear); + return -1; + } /* number of ksyms, func_lengths, and tags should match */ sub_prog_cnt = info->nr_jited_ksyms; if (sub_prog_cnt != info->nr_prog_tags || - sub_prog_cnt != info->nr_jited_func_lens) + sub_prog_cnt != info->nr_jited_func_lens) { + free(info_linear); return -1; + } /* check BTF func info support */ if (info->btf_id && info->nr_func_info && info->func_info_rec_size) { /* btf func info number should be same as sub_prog_cnt */ if (sub_prog_cnt != info->nr_func_info) { pr_debug("%s: mismatch in BPF sub program count and BTF function info count, aborting\n", __func__); - err = -1; - goto out; + free(info_linear); + return -1; } if (btf__get_from_id(info->btf_id, &btf)) { pr_debug("%s: failed to get BTF of id %u, aborting\n", __func__, info->btf_id); |