Skip to content

Commit d40f74a

Browse files
committed
mm/huge_memory.c: fix used-uninitialized
Fix used-uninitialized of `page'. Fixes: dce7d10 ("mm/madvise: optimize lazyfreeing with mTHP in madvise_free") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected] Cc: Lance Yang <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent f41e355 commit d40f74a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mm/huge_memory.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2696,7 +2696,6 @@ static bool __discard_anon_folio_pmd_locked(struct vm_area_struct *vma,
26962696
struct mm_struct *mm = vma->vm_mm;
26972697
int ref_count, map_count;
26982698
pmd_t orig_pmd = *pmdp;
2699-
struct page *page;
27002699

27012700
if (folio_test_dirty(folio) || pmd_dirty(orig_pmd))
27022701
return false;
@@ -2732,7 +2731,7 @@ static bool __discard_anon_folio_pmd_locked(struct vm_area_struct *vma,
27322731
return false;
27332732
}
27342733

2735-
folio_remove_rmap_pmd(folio, page, vma);
2734+
folio_remove_rmap_pmd(folio, pmd_page(orig_pmd), vma);
27362735
zap_deposited_table(mm, pmdp);
27372736
add_mm_counter(mm, MM_ANONPAGES, -HPAGE_PMD_NR);
27382737
if (vma->vm_flags & VM_LOCKED)

0 commit comments

Comments
 (0)