aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r--kernel/bpf/syscall.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index a31a1ba0f8ea..b41c6cf2eb88 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -575,7 +575,7 @@ static struct bpf_map *bpf_map_inc_not_zero(struct bpf_map *map,
575{ 575{
576 int refold; 576 int refold;
577 577
578 refold = __atomic_add_unless(&map->refcnt, 1, 0); 578 refold = atomic_fetch_add_unless(&map->refcnt, 1, 0);
579 579
580 if (refold >= BPF_MAX_REFCNT) { 580 if (refold >= BPF_MAX_REFCNT) {
581 __bpf_map_put(map, false); 581 __bpf_map_put(map, false);
@@ -1144,7 +1144,7 @@ struct bpf_prog *bpf_prog_inc_not_zero(struct bpf_prog *prog)
1144{ 1144{
1145 int refold; 1145 int refold;
1146 1146
1147 refold = __atomic_add_unless(&prog->aux->refcnt, 1, 0); 1147 refold = atomic_fetch_add_unless(&prog->aux->refcnt, 1, 0);
1148 1148
1149 if (refold >= BPF_MAX_REFCNT) { 1149 if (refold >= BPF_MAX_REFCNT) {
1150 __bpf_prog_put(prog, false); 1150 __bpf_prog_put(prog, false);