Commit 8f58ee54 authored by Yafang Shao's avatar Yafang Shao Committed by Alexei Starovoitov

bpf: Use bpf_map_area_free instread of kvfree

bpf_map_area_alloc() should be paired with bpf_map_area_free().
Signed-off-by: default avatarYafang Shao <laoar.shao@gmail.com>
Link: https://lore.kernel.org/r/20220810151840.16394-3-laoar.shao@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 08381815
...@@ -116,7 +116,7 @@ static struct bpf_ringbuf *bpf_ringbuf_area_alloc(size_t data_sz, int numa_node) ...@@ -116,7 +116,7 @@ static struct bpf_ringbuf *bpf_ringbuf_area_alloc(size_t data_sz, int numa_node)
err_free_pages: err_free_pages:
for (i = 0; i < nr_pages; i++) for (i = 0; i < nr_pages; i++)
__free_page(pages[i]); __free_page(pages[i]);
kvfree(pages); bpf_map_area_free(pages);
return NULL; return NULL;
} }
...@@ -190,7 +190,7 @@ static void bpf_ringbuf_free(struct bpf_ringbuf *rb) ...@@ -190,7 +190,7 @@ static void bpf_ringbuf_free(struct bpf_ringbuf *rb)
vunmap(rb); vunmap(rb);
for (i = 0; i < nr_pages; i++) for (i = 0; i < nr_pages; i++)
__free_page(pages[i]); __free_page(pages[i]);
kvfree(pages); bpf_map_area_free(pages);
} }
static void ringbuf_map_free(struct bpf_map *map) static void ringbuf_map_free(struct bpf_map *map)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment