Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b4c6841 authored by Yonghong Song's avatar Yonghong Song Committed by David S. Miller
Browse files

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: default avatarYonghong Song <yhs@fb.com>
Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 908d140a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -8191,10 +8191,10 @@ static void perf_event_free_bpf_prog(struct perf_event *event)
{
	struct bpf_prog *prog;

	if (event->attr.type != PERF_TYPE_TRACEPOINT) {
		perf_event_free_bpf_handler(event);

	if (!event->tp_event)
		return;
	}

	prog = event->tp_event->prog;
	if (prog && event->tp_event->bpf_prog_owner == event) {