Skip to content

Commit e1cae2d

Browse files
yonghong-songSomasundaram Krishnasamy
authored andcommitted
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 <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit 0b4c684) Orabug: 31667601 Signed-off-by: Alan Maguire <[email protected]> Reviewed-by: Mark Haywood <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent a42c985 commit e1cae2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/events/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8276,10 +8276,10 @@ static void perf_event_free_bpf_prog(struct perf_event *event)
82768276
{
82778277
struct bpf_prog *prog;
82788278

8279-
perf_event_free_bpf_handler(event);
8280-
8281-
if (!event->tp_event)
8279+
if (event->attr.type != PERF_TYPE_TRACEPOINT) {
8280+
perf_event_free_bpf_handler(event);
82828281
return;
8282+
}
82838283

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

0 commit comments

Comments
 (0)