mm/hmm: hmm_pfns_bad() was accessing wrong struct
authorJérôme Glisse <[email protected]>
Tue, 10 Apr 2018 23:28:27 +0000 (16:28 -0700)
committerLinus Torvalds <[email protected]>
Wed, 11 Apr 2018 17:28:30 +0000 (10:28 -0700)
The private field of mm_walk struct point to an hmm_vma_walk struct and
not to the hmm_range struct desired.  Fix to get proper struct pointer.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Jérôme Glisse <[email protected]>
Cc: Evgeny Baskakov <[email protected]>
Cc: Ralph Campbell <[email protected]>
Cc: Mark Hairgrove <[email protected]>
Cc: John Hubbard <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/hmm.c

index 2d00769e898508fabf19ba02dd006dcd502ded57..812a66997627c5da3a9d441d4ed3bb13a288fa5c 100644 (file)
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -336,7 +336,8 @@ static int hmm_pfns_bad(unsigned long addr,
                        unsigned long end,
                        struct mm_walk *walk)
 {
-       struct hmm_range *range = walk->private;
+       struct hmm_vma_walk *hmm_vma_walk = walk->private;
+       struct hmm_range *range = hmm_vma_walk->range;
        hmm_pfn_t *pfns = range->pfns;
        unsigned long i;