static int dax_iomap_pte_fault(struct vm_fault *vmf,
                               const struct iomap_ops *ops)
 {
-       struct address_space *mapping = vmf->vma->vm_file->f_mapping;
+       struct vm_area_struct *vma = vmf->vma;
+       struct address_space *mapping = vma->vm_file->f_mapping;
        struct inode *inode = mapping->host;
        unsigned long vaddr = vmf->address;
        loff_t pos = (loff_t)vmf->pgoff << PAGE_SHIFT;
        case IOMAP_MAPPED:
                if (iomap.flags & IOMAP_F_NEW) {
                        count_vm_event(PGMAJFAULT);
-                       count_memcg_event_mm(vmf->vma->vm_mm, PGMAJFAULT);
+                       count_memcg_event_mm(vma->vm_mm, PGMAJFAULT);
                        major = VM_FAULT_MAJOR;
                }
                error = dax_insert_mapping(vmf, &iomap, pos, entry);