commit | 781e62823cb81b972dc8652c1827205cda2ac9ac | [log] [tgz] |
---|---|---|
author | Peng Sun <sironhide0null@gmail.com> | Tue Feb 26 22:15:37 2019 +0800 |
committer | Daniel Borkmann <daniel@iogearbox.net> | Tue Feb 26 19:08:30 2019 +0100 |
tree | 7f97f6e117edfd62175df6776a0c208c9325988d | |
parent | 3da1ed7ac398f34fff1694017a07054d69c5f5c5 [diff] |
bpf: decrease usercnt if bpf_map_new_fd() fails in bpf_map_get_fd_by_id() In bpf/syscall.c, bpf_map_get_fd_by_id() use bpf_map_inc_not_zero() to increase the refcount, both map->refcnt and map->usercnt. Then, if bpf_map_new_fd() fails, should handle map->usercnt too. Fixes: bd5f5f4ecb78 ("bpf: Add BPF_MAP_GET_FD_BY_ID") Signed-off-by: Peng Sun <sironhide0null@gmail.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>