perf/bpf: Fix duplicate type check
[linux-2.6-block.git] / kernel / events / core.c
index f0f0f71213a1d387753a3d37a79ed7bddd44cc43..5ecfa57e3b97f6983dfe413cc17d8c5db903faf5 100644 (file)
@@ -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))