Commit 7524af98 authored by Russell King's avatar Russell King

[ARM] Prevent oops in free_pages() when freeing a pgd

free_pages() oopses if page->mapping is non-NULL.  Ensure that any
rmap datastructures for the page are freed before freeing the
concerned page.
parent c1759992
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/rmap.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/setup.h> #include <asm/setup.h>
...@@ -149,6 +150,7 @@ void free_pgd_slow(pgd_t *pgd) ...@@ -149,6 +150,7 @@ void free_pgd_slow(pgd_t *pgd)
pte = pmd_page(*pmd); pte = pmd_page(*pmd);
pmd_clear(pmd); pmd_clear(pmd);
pgtable_remove_rmap(pte);
pte_free(pte); pte_free(pte);
pmd_free(pmd); pmd_free(pmd);
free: free:
......
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