Skip to content

Commit ac00737

Browse files
tomratbertdavem330
authored andcommitted
bpf: Need to call bpf_prog_uncharge_memlock from bpf_prog_put
Currently, is only called from __prog_put_rcu in the bpf_prog_release path. Need this to call this from bpf_prog_put also to get correct accounting. Fixes: aaac3ba ("bpf: charge user for creation of BPF maps and programs") Signed-off-by: Tom Herbert <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a302afe commit ac00737

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/bpf/syscall.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ void bpf_prog_put(struct bpf_prog *prog)
520520
{
521521
if (atomic_dec_and_test(&prog->aux->refcnt)) {
522522
free_used_maps(prog->aux);
523+
bpf_prog_uncharge_memlock(prog);
523524
bpf_prog_free(prog);
524525
}
525526
}

0 commit comments

Comments
 (0)