The patch titled Subject: mm/memory_failure: fix the missing pte_unmap() call has been added to the -mm tree. Its filename is mm-memory_failure-fix-the-missing-pte_unmap-call.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-memory_failure-fix-the-missing-pte_unmap-call.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-memory_failure-fix-the-missing-pte_unmap-call.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx> Subject: mm/memory_failure: fix the missing pte_unmap() call The paired pte_unmap() call is missing before the dev_pagemap_mapping_shift() returns. So fix it. Davidsaid "I guess this code never runs on 32bit / highmem, that's why we didn't notice so far". Link: https://lkml.kernel.org/r/20210923122642.4999-1-zhengqi.arch@xxxxxxxxxxxxx Signed-off-by: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx> Reviewed-by: David Hildenbrand <david@xxxxxxxxxx> Cc: Naoya Horiguchi <naoya.horiguchi@xxxxxxx> Cc: Muchun Song <songmuchun@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory-failure.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/mm/memory-failure.c~mm-memory_failure-fix-the-missing-pte_unmap-call +++ a/mm/memory-failure.c @@ -306,6 +306,7 @@ static unsigned long dev_pagemap_mapping struct vm_area_struct *vma) { unsigned long address = vma_address(page, vma); + unsigned long ret = 0; pgd_t *pgd; p4d_t *p4d; pud_t *pud; @@ -330,10 +331,12 @@ static unsigned long dev_pagemap_mapping return PMD_SHIFT; pte = pte_offset_map(pmd, address); if (!pte_present(*pte)) - return 0; + goto unmap; if (pte_devmap(*pte)) - return PAGE_SHIFT; - return 0; + ret = PAGE_SHIFT; +unmap: + pte_unmap(pte); + return ret; } /* _ Patches currently in -mm which might be from zhengqi.arch@xxxxxxxxxxxxx are mm-memory_failure-fix-the-missing-pte_unmap-call.patch mm-introduce-pmd_install-helper.patch mm-remove-redundant-smp_wmb.patch