]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm-madvise-minor-cleanup-for-swapin_walk_pmd_entry-fix
authorAndrew Morton <akpm@linux-foundation.org>
Sat, 18 Jun 2022 18:58:03 +0000 (11:58 -0700)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 20 Jul 2022 00:15:10 +0000 (20:15 -0400)
reduce scope of `ptep'

Cc: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/madvise.c

index cf49e123991c1d71c08528daed1f34857be8f460..851fa4e134bc54afb15e19be95974257d8c8fc85 100644 (file)
@@ -195,7 +195,6 @@ success:
 static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned long start,
        unsigned long end, struct mm_walk *walk)
 {
-       pte_t *ptep;
        struct vm_area_struct *vma = walk->private;
        unsigned long index;
        struct swap_iocb *splug = NULL;
@@ -208,6 +207,7 @@ static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned long start,
                swp_entry_t entry;
                struct page *page;
                spinlock_t *ptl;
+               pte_t *ptep;
 
                ptep = pte_offset_map_lock(vma->vm_mm, pmd, index, &ptl);
                pte = *ptep;