Skip to content

Commit

Permalink
mm/huge_memory.c: fix used-uninitialized
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
akpm00 committed Jul 4, 2024
1 parent f41e355 commit d40f74a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -2696,7 +2696,6 @@ static bool __discard_anon_folio_pmd_locked(struct vm_area_struct *vma,
struct mm_struct *mm = vma->vm_mm;
int ref_count, map_count;
pmd_t orig_pmd = *pmdp;
struct page *page;

if (folio_test_dirty(folio) || pmd_dirty(orig_pmd))
return false;
Expand Down Expand Up @@ -2732,7 +2731,7 @@ static bool __discard_anon_folio_pmd_locked(struct vm_area_struct *vma,
return false;
}

folio_remove_rmap_pmd(folio, page, vma);
folio_remove_rmap_pmd(folio, pmd_page(orig_pmd), vma);
zap_deposited_table(mm, pmdp);
add_mm_counter(mm, MM_ANONPAGES, -HPAGE_PMD_NR);
if (vma->vm_flags & VM_LOCKED)
Expand Down

0 comments on commit d40f74a

Please sign in to comment.