mirror of
https://github.com/torvalds/linux.git
synced 2026-11-23 23:11:40 +00:00
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: aaac3ba95e ("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]>
This commit is contained in:
committed by
David S. Miller
parent
a302afe980
commit
ac00737f4e
@@ -520,6 +520,7 @@ void bpf_prog_put(struct bpf_prog *prog)
|
||||
{
|
||||
if (atomic_dec_and_test(&prog->aux->refcnt)) {
|
||||
free_used_maps(prog->aux);
|
||||
bpf_prog_uncharge_memlock(prog);
|
||||
bpf_prog_free(prog);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user