Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- kernel/bpf/ringbuf.c | 2 ++
+ kernel/bpf/ringbuf.c | 2 ++
1 file changed, 2 insertions(+)
-diff --git a/kernel/bpf/ringbuf.c b/kernel/bpf/ringbuf.c
-index eb6ff0d0c06b6..5798d6dbdcb43 100644
--- a/kernel/bpf/ringbuf.c
+++ b/kernel/bpf/ringbuf.c
-@@ -184,6 +184,8 @@ static struct bpf_map *ringbuf_map_alloc(union bpf_attr *attr)
+@@ -190,6 +190,8 @@ static void bpf_ringbuf_free(struct bpf_
+ struct page **pages = rb->pages;
+ int i, nr_pages = rb->nr_pages;
- static void bpf_ringbuf_free(struct bpf_ringbuf *rb)
- {
+ irq_work_sync(&rb->work);
+
- /* copy pages pointer and nr_pages to local variable, as we are going
- * to unmap rb itself with vunmap() below
- */
---
-2.51.0
-
+ vunmap(rb);
+ for (i = 0; i < nr_pages; i++)
+ __free_page(pages[i]);