VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Vegard Nossum <vegard.nossum@oracle.com> 2017-02-27 14:30:07 -0800 committer: Linus Torvalds <torvalds@linux-foundation.org> 2017-02-27 18:43:48 -0800 commit: f1f1007644ffc8051a4c11427d58b1967ae7b75a parent: 522b837c672eba9e9fb69f9f52bced0256dc6697
Commit Summary:
mm: add new mmgrab() helper
Diffstat:
1 file changed, 1 insertion, 1 deletion
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index e6e0a619cb3a..3c421d06a18e 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -1847,7 +1847,7 @@ static struct file *userfaultfd_file_create(int flags)
 	ctx->released = false;
 	ctx->mm = current->mm;
 	/* prevent the mm struct to be freed */
-	atomic_inc(&ctx->mm->mm_count);
+	mmgrab(ctx->mm);
 
 	file = anon_inode_getfile("[userfaultfd]", &userfaultfd_fops, ctx,
 				  O_RDWR | (flags & UFFD_SHARED_FCNTL_FLAGS));