Commit 7b358c6f authored by Ralph Campbell's avatar Ralph Campbell Committed by Linus Torvalds

mm/migrate.c: initialize pud_entry in migrate_vma()

When CONFIG_MIGRATE_VMA_HELPER is enabled, migrate_vma() calls
migrate_vma_collect() which initializes a struct mm_walk but didn't
initialize mm_walk.pud_entry.  (Found by code inspection) Use a C
structure initialization to make sure it is set to NULL.

Link: http://lkml.kernel.org/r/20190719233225.12243-1-rcampbell@nvidia.com
Fixes: 8763cb45 ("mm/migrate: new memory migration helper for use with device memory")
Signed-off-by: default avatarRalph Campbell <rcampbell@nvidia.com>
Reviewed-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: "Jérôme Glisse" <jglisse@redhat.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 315c6926
...@@ -2340,16 +2340,13 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, ...@@ -2340,16 +2340,13 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp,
static void migrate_vma_collect(struct migrate_vma *migrate) static void migrate_vma_collect(struct migrate_vma *migrate)
{ {
struct mmu_notifier_range range; struct mmu_notifier_range range;
struct mm_walk mm_walk; struct mm_walk mm_walk = {
.pmd_entry = migrate_vma_collect_pmd,
mm_walk.pmd_entry = migrate_vma_collect_pmd; .pte_hole = migrate_vma_collect_hole,
mm_walk.pte_entry = NULL; .vma = migrate->vma,
mm_walk.pte_hole = migrate_vma_collect_hole; .mm = migrate->vma->vm_mm,
mm_walk.hugetlb_entry = NULL; .private = migrate,
mm_walk.test_walk = NULL; };
mm_walk.vma = migrate->vma;
mm_walk.mm = migrate->vma->vm_mm;
mm_walk.private = migrate;
mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, NULL, mm_walk.mm, mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, NULL, mm_walk.mm,
migrate->start, migrate->start,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment