sfc: fix a double-free bug in efx_probe_filters
[platform/kernel/linux-rpi.git] / mm / hugetlb.c
index 1301ba7..5e6c4d3 100644 (file)
@@ -1189,6 +1189,13 @@ static int is_vma_resv_set(struct vm_area_struct *vma, unsigned long flag)
        return (get_vma_private_data(vma) & flag) != 0;
 }
 
+bool __vma_private_lock(struct vm_area_struct *vma)
+{
+       return !(vma->vm_flags & VM_MAYSHARE) &&
+               get_vma_private_data(vma) & ~HPAGE_RESV_MASK &&
+               is_vma_resv_set(vma, HPAGE_RESV_OWNER);
+}
+
 void hugetlb_dup_vma_private(struct vm_area_struct *vma)
 {
        VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
@@ -6520,7 +6527,7 @@ struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma,
                        }
                }
 
-               page += ((address & ~huge_page_mask(h)) >> PAGE_SHIFT);
+               page = nth_page(page, ((address & ~huge_page_mask(h)) >> PAGE_SHIFT));
 
                /*
                 * Note that page may be a sub-page, and with vmemmap