diff options
| author | Greg Kroah-Hartman <[email protected]> | 2021-08-09 07:03:47 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2021-08-09 07:03:47 +0000 |
| commit | bd935a7b21340e2e37f51a7f2d3188145e2fcf1f (patch) | |
| tree | ac8af4e6ea552d32839c415b2f36d416ee327ea4 /arch/mips/include/asm/pgalloc.h | |
| parent | Merge tag 'sysfs_defferred_iomem_get_mapping-5.15' of git://git.kernel.org/pu... (diff) | |
| parent | Linux 5.14-rc5 (diff) | |
| download | kernel-bd935a7b21340e2e37f51a7f2d3188145e2fcf1f.tar.gz kernel-bd935a7b21340e2e37f51a7f2d3188145e2fcf1f.zip | |
Merge 5.14-rc5 into driver-core-next
We need the driver core fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'arch/mips/include/asm/pgalloc.h')
| -rw-r--r-- | arch/mips/include/asm/pgalloc.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h index 4b2567d6b2df..c7925d0e9874 100644 --- a/arch/mips/include/asm/pgalloc.h +++ b/arch/mips/include/asm/pgalloc.h @@ -58,15 +58,20 @@ do { \ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) { - pmd_t *pmd = NULL; + pmd_t *pmd; struct page *pg; - pg = alloc_pages(GFP_KERNEL | __GFP_ACCOUNT, PMD_ORDER); - if (pg) { - pgtable_pmd_page_ctor(pg); - pmd = (pmd_t *)page_address(pg); - pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table); + pg = alloc_pages(GFP_KERNEL_ACCOUNT, PMD_ORDER); + if (!pg) + return NULL; + + if (!pgtable_pmd_page_ctor(pg)) { + __free_pages(pg, PMD_ORDER); + return NULL; } + + pmd = (pmd_t *)page_address(pg); + pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table); return pmd; } |
