summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorYafang Shao <laoar.shao@gmail.com>2022-08-10 18:18:27 +0300
committerAlexei Starovoitov <ast@kernel.org>2022-08-10 21:48:44 +0300
commit8f58ee54c2eae790f50c51dfa64a153601451f08 (patch)
tree32a38c0218cf709f320c21509475b4bd90c0cab9 /kernel
parent083818156d1e98f22b1ac612a3957bc553e7ba57 (diff)
downloadlinux-8f58ee54c2eae790f50c51dfa64a153601451f08.tar.xz
bpf: Use bpf_map_area_free instread of kvfree
bpf_map_area_alloc() should be paired with bpf_map_area_free(). Signed-off-by: Yafang Shao <laoar.shao@gmail.com> Link: https://lore.kernel.org/r/20220810151840.16394-3-laoar.shao@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/bpf/ringbuf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/bpf/ringbuf.c b/kernel/bpf/ringbuf.c
index ded4faeca192..3fb54feb39d4 100644
--- a/kernel/bpf/ringbuf.c
+++ b/kernel/bpf/ringbuf.c
@@ -116,7 +116,7 @@ static struct bpf_ringbuf *bpf_ringbuf_area_alloc(size_t data_sz, int numa_node)
err_free_pages:
for (i = 0; i < nr_pages; i++)
__free_page(pages[i]);
- kvfree(pages);
+ bpf_map_area_free(pages);
return NULL;
}
@@ -190,7 +190,7 @@ static void bpf_ringbuf_free(struct bpf_ringbuf *rb)
vunmap(rb);
for (i = 0; i < nr_pages; i++)
__free_page(pages[i]);
- kvfree(pages);
+ bpf_map_area_free(pages);
}
static void ringbuf_map_free(struct bpf_map *map)