userfaultfd: use mmgrab instead of open-coded increment of mm_count
[sfrench/cifs-2.6.git] / fs / userfaultfd.c
index f46d133c094998c48eada7a4e2bd8f5a69239ffa..ac9a4e65ca497ad3b673dc50893d13b44150c70f 100644 (file)
@@ -668,7 +668,7 @@ int dup_userfaultfd(struct vm_area_struct *vma, struct list_head *fcs)
                ctx->features = octx->features;
                ctx->released = false;
                ctx->mm = vma->vm_mm;
                ctx->features = octx->features;
                ctx->released = false;
                ctx->mm = vma->vm_mm;
-               atomic_inc(&ctx->mm->mm_count);
+               mmgrab(ctx->mm);
 
                userfaultfd_ctx_get(octx);
                fctx->orig = octx;
 
                userfaultfd_ctx_get(octx);
                fctx->orig = octx;