aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r--mm/vmalloc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 1d9878b7cf52..1bf94ad452b6 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1290,12 +1290,14 @@ struct vm_struct *vmlist;
1290static void setup_vmalloc_vm(struct vm_struct *vm, struct vmap_area *va, 1290static void setup_vmalloc_vm(struct vm_struct *vm, struct vmap_area *va,
1291 unsigned long flags, const void *caller) 1291 unsigned long flags, const void *caller)
1292{ 1292{
1293 spin_lock(&vmap_area_lock);
1293 vm->flags = flags; 1294 vm->flags = flags;
1294 vm->addr = (void *)va->va_start; 1295 vm->addr = (void *)va->va_start;
1295 vm->size = va->va_end - va->va_start; 1296 vm->size = va->va_end - va->va_start;
1296 vm->caller = caller; 1297 vm->caller = caller;
1297 va->vm = vm; 1298 va->vm = vm;
1298 va->flags |= VM_VM_AREA; 1299 va->flags |= VM_VM_AREA;
1300 spin_unlock(&vmap_area_lock);
1299} 1301}
1300 1302
1301static void insert_vmalloc_vmlist(struct vm_struct *vm) 1303static void insert_vmalloc_vmlist(struct vm_struct *vm)
@@ -1447,6 +1449,11 @@ struct vm_struct *remove_vm_area(const void *addr)
1447 if (va && va->flags & VM_VM_AREA) { 1449 if (va && va->flags & VM_VM_AREA) {
1448 struct vm_struct *vm = va->vm; 1450 struct vm_struct *vm = va->vm;
1449 1451
1452 spin_lock(&vmap_area_lock);
1453 va->vm = NULL;
1454 va->flags &= ~VM_VM_AREA;
1455 spin_unlock(&vmap_area_lock);
1456
1450 if (!(vm->flags & VM_UNLIST)) { 1457 if (!(vm->flags & VM_UNLIST)) {
1451 struct vm_struct *tmp, **p; 1458 struct vm_struct *tmp, **p;
1452 /* 1459 /*