summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/pgalloc.h
diff options
context:
space:
mode:
authorYoshinori Sato <ysato@users.sourceforge.jp>2019-06-02 15:46:11 +0900
committerYoshinori Sato <ysato@users.sourceforge.jp>2019-06-02 15:46:11 +0900
commit860dbce3d8dd90cb9e909c58fa79808766243651 (patch)
treef68920c82fa779ae37bbce08a58259e5c3934ab3 /arch/arm64/include/asm/pgalloc.h
parent1b496469d0c020e09124e03e66a81421c21272a7 (diff)
parent3ab4436f688c2d2f221793953cd05435ca84261c (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
Diffstat (limited to 'arch/arm64/include/asm/pgalloc.h')
-rw-r--r--arch/arm64/include/asm/pgalloc.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/pgalloc.h b/arch/arm64/include/asm/pgalloc.h
index 52fa47c73bf0..dabba4b2c61f 100644
--- a/arch/arm64/include/asm/pgalloc.h
+++ b/arch/arm64/include/asm/pgalloc.h
@@ -33,12 +33,22 @@
static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
{
- return (pmd_t *)__get_free_page(PGALLOC_GFP);
+ struct page *page;
+
+ page = alloc_page(PGALLOC_GFP);
+ if (!page)
+ return NULL;
+ if (!pgtable_pmd_page_ctor(page)) {
+ __free_page(page);
+ return NULL;
+ }
+ return page_address(page);
}
static inline void pmd_free(struct mm_struct *mm, pmd_t *pmdp)
{
BUG_ON((unsigned long)pmdp & (PAGE_SIZE-1));
+ pgtable_pmd_page_dtor(virt_to_page(pmdp));
free_page((unsigned long)pmdp);
}