MMU notifier callback may pass in mm with mm->mm_users==0 when process
is exiting, use mmget_no_zero to avoid accessing invalid mm in deferred
list work after mm is gone.
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
 
        if (range->event == MMU_NOTIFY_RELEASE)
                return true;
+       if (!mmget_not_zero(mni->mm))
+               return true;
 
        start = mni->interval_tree.start;
        last = mni->interval_tree.last;
        }
 
        svm_range_unlock(prange);
+       mmput(mni->mm);
 
        return true;
 }