diff options
author | Yonghong Song <yhs@fb.com> | 2017-10-24 08:53:07 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-25 03:47:46 +0200 |
commit | 0b4c6841fee03e096b735074a0c4aab3a8e92986 (patch) | |
tree | 3066cb26b51427492db61b5ffe5a795f007adf68 /kernel/events | |
parent | ip6_tunnel: Allow rcv/xmit even if remote address is a local address (diff) | |
download | linux-0b4c6841fee03e096b735074a0c4aab3a8e92986.tar.xz linux-0b4c6841fee03e096b735074a0c4aab3a8e92986.zip |
bpf: use the same condition in perf event set/free bpf handler
This is a cleanup such that doing the same check in
perf_event_free_bpf_prog as we already do in
perf_event_set_bpf_prog step.
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 31ee304a5844..9f78a6825bbe 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -8191,10 +8191,10 @@ static void perf_event_free_bpf_prog(struct perf_event *event) { struct bpf_prog *prog; - perf_event_free_bpf_handler(event); - - if (!event->tp_event) + if (event->attr.type != PERF_TYPE_TRACEPOINT) { + perf_event_free_bpf_handler(event); return; + } prog = event->tp_event->prog; if (prog && event->tp_event->bpf_prog_owner == event) { |