summaryrefslogtreecommitdiff
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2021-05-04 18:33:49 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-05-05 11:27:20 -0700
commit8fd5eda4c7268b62f46b2ed76b96f9e41e128a47 (patch)
treef11de032851597b7629f134a15311b5f6170a436 /mm/huge_memory.c
parent74e579bf231a337ab3786d59e64bc94f45ca7b3f (diff)
downloadlwn-8fd5eda4c7268b62f46b2ed76b96f9e41e128a47.tar.gz
lwn-8fd5eda4c7268b62f46b2ed76b96f9e41e128a47.zip
mm/huge_memory.c: remove unnecessary local variable ret2
There is no need to use a new local variable ret2 to get the return value of handle_userfault(). Use ret directly to make code more succinct. Link: https://lkml.kernel.org/r/20210210072409.60587-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Mike Kravetz <mike.kravetz@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index ae907a9c2050..bff92dea5ab3 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -624,14 +624,12 @@ static vm_fault_t __do_huge_pmd_anonymous_page(struct vm_fault *vmf,
/* Deliver the page fault to userland */
if (userfaultfd_missing(vma)) {
- vm_fault_t ret2;
-
spin_unlock(vmf->ptl);
put_page(page);
pte_free(vma->vm_mm, pgtable);
- ret2 = handle_userfault(vmf, VM_UFFD_MISSING);
- VM_BUG_ON(ret2 & VM_FAULT_FALLBACK);
- return ret2;
+ ret = handle_userfault(vmf, VM_UFFD_MISSING);
+ VM_BUG_ON(ret & VM_FAULT_FALLBACK);
+ return ret;
}
entry = mk_huge_pmd(page, vma->vm_page_prot);