lkml.org 
[lkml]   [2020]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] mm/vmalloc: use free_vm_area() if an allocation fails
Date
There is a dedicated and separate function that finds and
removes a continuous kernel virtual area. As a final step
it also releases the "area", a descriptor of corresponding
vm_struct.

Use free_vmap_area() in the __vmalloc_node_range() instead
of open coded steps which are exactly the same, to perform
a cleanup.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
mm/vmalloc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index d7075ad340aa..b08b06a8cc2a 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2479,8 +2479,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
}

if (!pages) {
- remove_vm_area(area->addr);
- kfree(area);
+ free_vm_area(area);
return NULL;
}

--
2.20.1
\
 
 \ /
  Last update: 2020-11-16 23:04    [W:0.055 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site