diff options
-rw-r--r-- | mm/page_alloc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2ad2ad168efe..4ba5e37127fc 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5978,8 +5978,15 @@ done: | |||
5978 | 5978 | ||
5979 | void free_contig_range(unsigned long pfn, unsigned nr_pages) | 5979 | void free_contig_range(unsigned long pfn, unsigned nr_pages) |
5980 | { | 5980 | { |
5981 | for (; nr_pages--; ++pfn) | 5981 | unsigned int count = 0; |
5982 | __free_page(pfn_to_page(pfn)); | 5982 | |
5983 | for (; nr_pages--; pfn++) { | ||
5984 | struct page *page = pfn_to_page(pfn); | ||
5985 | |||
5986 | count += page_count(page) != 1; | ||
5987 | __free_page(page); | ||
5988 | } | ||
5989 | WARN(count != 0, "%d pages are still in use!\n", count); | ||
5983 | } | 5990 | } |
5984 | #endif | 5991 | #endif |
5985 | 5992 | ||