mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
mm: fix dubious code in __count_immobile_pages()
When pfn_valid_within() failed 'iter' was incremented twice. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
a2d6d2fa90
commit
29723fccc8
1 changed files with 2 additions and 3 deletions
|
@ -5376,10 +5376,9 @@ __count_immobile_pages(struct zone *zone, struct page *page, int count)
|
|||
for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) {
|
||||
unsigned long check = pfn + iter;
|
||||
|
||||
if (!pfn_valid_within(check)) {
|
||||
iter++;
|
||||
if (!pfn_valid_within(check))
|
||||
continue;
|
||||
}
|
||||
|
||||
page = pfn_to_page(check);
|
||||
if (!page_count(page)) {
|
||||
if (PageBuddy(page))
|
||||
|
|
Loading…
Reference in a new issue