percpu: stop leaking bitmap metadata blocks
authorMike Rapoport <rppt@linux.vnet.ibm.com>
Sun, 7 Oct 2018 08:31:51 +0000 (11:31 +0300)
committerDennis Zhou <dennis@kernel.org>
Sun, 7 Oct 2018 21:50:12 +0000 (14:50 -0700)
The commit ca460b3c9627 ("percpu: introduce bitmap metadata blocks")
introduced bitmap metadata blocks. These metadata blocks are allocated
whenever a new chunk is created, but they are never freed. Fix it.

Fixes: ca460b3c9627 ("percpu: introduce bitmap metadata blocks")
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dennis Zhou <dennis@kernel.org>
mm/percpu.c

index a749d4d96e3ec72baa7da9c325230855243e0bfa..4b90682623e926b23a6fb675cac41b94db5a41b3 100644 (file)
@@ -1212,6 +1212,7 @@ static void pcpu_free_chunk(struct pcpu_chunk *chunk)
 {
        if (!chunk)
                return;
+       pcpu_mem_free(chunk->md_blocks);
        pcpu_mem_free(chunk->bound_map);
        pcpu_mem_free(chunk->alloc_map);
        pcpu_mem_free(chunk);