diff options
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r-- | kernel/bpf/syscall.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index ec7c552af76b..797a99c7493e 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c | |||
@@ -577,12 +577,12 @@ static int map_create(union bpf_attr *attr) | |||
577 | err = bpf_map_new_fd(map, f_flags); | 577 | err = bpf_map_new_fd(map, f_flags); |
578 | if (err < 0) { | 578 | if (err < 0) { |
579 | /* failed to allocate fd. | 579 | /* failed to allocate fd. |
580 | * bpf_map_put() is needed because the above | 580 | * bpf_map_put_with_uref() is needed because the above |
581 | * bpf_map_alloc_id() has published the map | 581 | * bpf_map_alloc_id() has published the map |
582 | * to the userspace and the userspace may | 582 | * to the userspace and the userspace may |
583 | * have refcnt-ed it through BPF_MAP_GET_FD_BY_ID. | 583 | * have refcnt-ed it through BPF_MAP_GET_FD_BY_ID. |
584 | */ | 584 | */ |
585 | bpf_map_put(map); | 585 | bpf_map_put_with_uref(map); |
586 | return err; | 586 | return err; |
587 | } | 587 | } |
588 | 588 | ||
@@ -2025,7 +2025,7 @@ static int bpf_map_get_fd_by_id(const union bpf_attr *attr) | |||
2025 | 2025 | ||
2026 | fd = bpf_map_new_fd(map, f_flags); | 2026 | fd = bpf_map_new_fd(map, f_flags); |
2027 | if (fd < 0) | 2027 | if (fd < 0) |
2028 | bpf_map_put(map); | 2028 | bpf_map_put_with_uref(map); |
2029 | 2029 | ||
2030 | return fd; | 2030 | return fd; |
2031 | } | 2031 | } |