diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-17 00:51:31 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-17 00:51:31 -0400 |
| commit | a2e30e529a48ef4e106e405f91cf4ae525bb01c4 (patch) | |
| tree | 2def96ef17c0672c30f1a10287552978bf1d0b1c /mm/hugetlb.c | |
| parent | edb3366703224d5d8df573ae698ccd6b488dc743 (diff) | |
| parent | 2ad56496627630ebc99f06af5f81ca23e17e014e (diff) | |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'mm/hugetlb.c')
| -rw-r--r-- | mm/hugetlb.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index fbd1111ea11..6bf720bc662 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -301,6 +301,7 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, { struct mm_struct *mm = vma->vm_mm; unsigned long address; + pte_t *ptep; pte_t pte; struct page *page; @@ -309,9 +310,17 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, BUG_ON(end & ~HPAGE_MASK); for (address = start; address < end; address += HPAGE_SIZE) { - pte = huge_ptep_get_and_clear(mm, address, huge_pte_offset(mm, address)); + ptep = huge_pte_offset(mm, address); + if (! ptep) + /* This can happen on truncate, or if an + * mmap() is aborted due to an error before + * the prefault */ + continue; + + pte = huge_ptep_get_and_clear(mm, address, ptep); if (pte_none(pte)) continue; + page = pte_page(pte); put_page(page); } |
