Commit f0db1328 authored by Andrew Morton's avatar Andrew Morton Committed by Liu Shixin
Browse files

mm/huge_memory.c: fix used-uninitialized

mainline inclusion
from mainline-v6.11-rc1
commit d40f74ab9d6158979a20957ead0e0dec7040ec37
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAIHQO

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d40f74ab9d6158979a20957ead0e0dec7040ec37



--------------------------------

Fix used-uninitialized of `page'.

Fixes: dce7d10be4bb ("mm/madvise: optimize lazyfreeing with mTHP in madvise_free")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406260514.SLhNM9kQ-lkp@intel.com


Cc: Lance Yang <ioworker0@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent a4130bbe
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2864,7 +2864,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;
@@ -2900,7 +2899,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)