summaryrefslogtreecommitdiffstats
path: root/kernel/bpf/syscall.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-03-02 15:54:35 -0500
committerDavid S. Miller <davem@davemloft.net>2019-03-02 15:54:35 -0500
commit9eb359140cd307f8a14f61c19b155ffca5291057 (patch)
tree22d5143608ef1744ca4b7025414777defe8bcca5 /kernel/bpf/syscall.c
parentcf29576fee6016fa7004262cb98f57a2269178f1 (diff)
parent07f12b26e21ab359261bf75cfcb424fdc7daeb6d (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r--kernel/bpf/syscall.c6
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}