diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-21 15:24:03 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-21 15:24:03 -0700 |
commit | 490fc053865c9cc40f1085ef8a5504f5341f79d2 (patch) | |
tree | 95f2e6e189cdae1a5e638b7ea4e39502605eaaa8 /mm/nommu.c | |
parent | 95faf6992df468f617edb788da8c21c6eed0dfa7 (diff) | |
download | lwn-490fc053865c9cc40f1085ef8a5504f5341f79d2.tar.gz lwn-490fc053865c9cc40f1085ef8a5504f5341f79d2.zip |
mm: make vm_area_alloc() initialize core fields
Like vm_area_dup(), it initializes the anon_vma_chain head, and the
basic mm pointer.
The rest of the fields end up being different for different users,
although the plan is to also initialize the 'vm_ops' field to a dummy
entry.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/nommu.c')
-rw-r--r-- | mm/nommu.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/nommu.c b/mm/nommu.c index c2560e9cc803..1d22fdbf7d7c 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -1204,7 +1204,7 @@ unsigned long do_mmap(struct file *file, if (!region) goto error_getting_region; - vma = vm_area_alloc(); + vma = vm_area_alloc(current->mm); if (!vma) goto error_getting_vma; @@ -1212,7 +1212,6 @@ unsigned long do_mmap(struct file *file, region->vm_flags = vm_flags; region->vm_pgoff = pgoff; - INIT_LIST_HEAD(&vma->anon_vma_chain); vma->vm_flags = vm_flags; vma->vm_pgoff = pgoff; |