summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorFlorian Lehner <dev@der-flo.net>2024-01-20 16:09:20 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2024-01-29 22:40:37 +0100
commitaecaa3ed48c3ae74c06f5e8ef0746b69c62397f1 (patch)
tree595fcd3705bd6c5641be5b3c794cbfe53f47e71d /kernel
parent646751d523587cfd7ebcf1733298ecd470879eda (diff)
perf/bpf: Fix duplicate type check
Remove the duplicate check on type and unify result. Signed-off-by: Florian Lehner <dev@der-flo.net> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/bpf/20240120150920.3370-1-dev@der-flo.net
Diffstat (limited to 'kernel')
-rw-r--r--kernel/events/core.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index f0f0f71213a1..5ecfa57e3b97 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -9302,10 +9302,6 @@ void perf_event_bpf_event(struct bpf_prog *prog,
{
struct perf_bpf_event bpf_event;
- if (type <= PERF_BPF_EVENT_UNKNOWN ||
- type >= PERF_BPF_EVENT_MAX)
- return;
-
switch (type) {
case PERF_BPF_EVENT_PROG_LOAD:
case PERF_BPF_EVENT_PROG_UNLOAD:
@@ -9313,7 +9309,7 @@ void perf_event_bpf_event(struct bpf_prog *prog,
perf_event_bpf_emit_ksymbols(prog, type);
break;
default:
- break;
+ return;
}
if (!atomic_read(&nr_bpf_events))