Commit 44e2aa93 authored by Dean Nelson's avatar Dean Nelson Committed by Linus Torvalds

mm/hugetlb.c: add missing spin_lock() to hugetlb_cow()

Add missing spin_lock() of the page_table_lock before an error return in
hugetlb_cow(). Callers of hugtelb_cow() expect it to be held upon return.
Signed-off-by: default avatarDean Nelson <>
Cc: Mel Gorman <>
Cc: <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 70384dc6
......@@ -2448,8 +2448,11 @@ retry_avoidcopy:
* When the original hugepage is shared one, it does not have
* anon_vma prepared.
if (unlikely(anon_vma_prepare(vma)))
if (unlikely(anon_vma_prepare(vma))) {
/* Caller expects lock to be held */
return VM_FAULT_OOM;
copy_user_huge_page(new_page, old_page, address, vma);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment