diff options
| author | Wei Yang <[email protected]> | 2018-06-08 00:06:39 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2018-06-08 00:34:35 +0000 |
| commit | d538c164fc018bdb79f07f904fa9d48acf18bb0a (patch) | |
| tree | 229420d94dcf7f7c0950d8b92cf621501167525c /mm/sparse.c | |
| parent | mm, gup: prevent pmd checking race in follow_pmd_mask() (diff) | |
| download | kernel-d538c164fc018bdb79f07f904fa9d48acf18bb0a.tar.gz kernel-d538c164fc018bdb79f07f904fa9d48acf18bb0a.zip | |
mm/sparse.c: check __highest_present_section_nr only for a present section
When searching a present section, there are two boundaries:
* __highest_present_section_nr
* NR_MEM_SECTIONS
And it is known, __highest_present_section_nr is a more strict boundary
than NR_MEM_SECTIONS. This means it would be necessary to check
__highest_present_section_nr only.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Wei Yang <[email protected]>
Acked-by: David Rientjes <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Dave Hansen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'mm/sparse.c')
| -rw-r--r-- | mm/sparse.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/sparse.c b/mm/sparse.c index 73dc2fcc0eab..3570ff294ab1 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -190,15 +190,13 @@ static inline int next_present_section_nr(int section_nr) section_nr++; if (present_section_nr(section_nr)) return section_nr; - } while ((section_nr < NR_MEM_SECTIONS) && - (section_nr <= __highest_present_section_nr)); + } while ((section_nr <= __highest_present_section_nr)); return -1; } #define for_each_present_section_nr(start, section_nr) \ for (section_nr = next_present_section_nr(start-1); \ ((section_nr >= 0) && \ - (section_nr < NR_MEM_SECTIONS) && \ (section_nr <= __highest_present_section_nr)); \ section_nr = next_present_section_nr(section_nr)) |
