Commit aecaa3ed authored by Florian Lehner's avatar Florian Lehner Committed by Daniel Borkmann

perf/bpf: Fix duplicate type check

Remove the duplicate check on type and unify result.
Signed-off-by: default avatarFlorian Lehner <dev@der-flo.net>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarSong Liu <song@kernel.org>
Link: https://lore.kernel.org/bpf/20240120150920.3370-1-dev@der-flo.net
parent 646751d5
...@@ -9302,10 +9302,6 @@ void perf_event_bpf_event(struct bpf_prog *prog, ...@@ -9302,10 +9302,6 @@ void perf_event_bpf_event(struct bpf_prog *prog,
{ {
struct perf_bpf_event bpf_event; struct perf_bpf_event bpf_event;
if (type <= PERF_BPF_EVENT_UNKNOWN ||
type >= PERF_BPF_EVENT_MAX)
return;
switch (type) { switch (type) {
case PERF_BPF_EVENT_PROG_LOAD: case PERF_BPF_EVENT_PROG_LOAD:
case PERF_BPF_EVENT_PROG_UNLOAD: case PERF_BPF_EVENT_PROG_UNLOAD:
...@@ -9313,7 +9309,7 @@ void perf_event_bpf_event(struct bpf_prog *prog, ...@@ -9313,7 +9309,7 @@ void perf_event_bpf_event(struct bpf_prog *prog,
perf_event_bpf_emit_ksymbols(prog, type); perf_event_bpf_emit_ksymbols(prog, type);
break; break;
default: default:
break; return;
} }
if (!atomic_read(&nr_bpf_events)) if (!atomic_read(&nr_bpf_events))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment