diff mbox series

percpu: stop leaking bitmap metadata blocks

Message ID 1538901111-22823-1-git-send-email-rppt@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show
Series percpu: stop leaking bitmap metadata blocks | expand

Commit Message

Mike Rapoport Oct. 7, 2018, 8:31 a.m. UTC
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
---
 mm/percpu.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dennis Zhou Oct. 7, 2018, 10:09 p.m. UTC | #1
Hi Mike,

On Sun, Oct 07, 2018 at 11:31:51AM +0300, Mike Rapoport wrote:
> 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
> ---
>  mm/percpu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/percpu.c b/mm/percpu.c
> index d21cb13..25104cd 100644
> --- a/mm/percpu.c
> +++ b/mm/percpu.c
> @@ -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);

Ah a bit of a boneheaded miss on my part.. Thanks for catching this!
I've applied it to for-4.19-fixes.

Thanks,
Dennis
diff mbox series

Patch

diff --git a/mm/percpu.c b/mm/percpu.c
index d21cb13..25104cd 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -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);