diff options
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 759deae4539a..c4071fa8e12a 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -1270,17 +1270,21 @@ struct vm_struct *remove_vm_area(const void *addr) | |||
1270 | if (va && va->flags & VM_VM_AREA) { | 1270 | if (va && va->flags & VM_VM_AREA) { |
1271 | struct vm_struct *vm = va->private; | 1271 | struct vm_struct *vm = va->private; |
1272 | struct vm_struct *tmp, **p; | 1272 | struct vm_struct *tmp, **p; |
1273 | 1273 | /* | |
1274 | vmap_debug_free_range(va->va_start, va->va_end); | 1274 | * remove from list and disallow access to this vm_struct |
1275 | free_unmap_vmap_area(va); | 1275 | * before unmap. (address range confliction is maintained by |
1276 | vm->size -= PAGE_SIZE; | 1276 | * vmap.) |
1277 | 1277 | */ | |
1278 | write_lock(&vmlist_lock); | 1278 | write_lock(&vmlist_lock); |
1279 | for (p = &vmlist; (tmp = *p) != vm; p = &tmp->next) | 1279 | for (p = &vmlist; (tmp = *p) != vm; p = &tmp->next) |
1280 | ; | 1280 | ; |
1281 | *p = tmp->next; | 1281 | *p = tmp->next; |
1282 | write_unlock(&vmlist_lock); | 1282 | write_unlock(&vmlist_lock); |
1283 | 1283 | ||
1284 | vmap_debug_free_range(va->va_start, va->va_end); | ||
1285 | free_unmap_vmap_area(va); | ||
1286 | vm->size -= PAGE_SIZE; | ||
1287 | |||
1284 | return vm; | 1288 | return vm; |
1285 | } | 1289 | } |
1286 | return NULL; | 1290 | return NULL; |