Skip to content

Commit a0615a1

Browse files
rarbabmpe
authored andcommitted
powerpc/mm: Use the correct pointer when setting a 2MB pte
When setting a 2MB pte, radix__map_kernel_page() is using the address ptep = (pte_t *)pudp; Fix this conversion to use pmdp instead. Use pmdp_ptep() to do this instead of casting the pointer. Fixes: 2bfd65e ("powerpc/mm/radix: Add radix callbacks for early init routines") Cc: stable@vger.kernel.org # v4.7+ Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent b5fa0f7 commit a0615a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/powerpc/mm/pgtable-radix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ int radix__map_kernel_page(unsigned long ea, unsigned long pa,
6565
if (!pmdp)
6666
return -ENOMEM;
6767
if (map_page_size == PMD_SIZE) {
68-
ptep = (pte_t *)pudp;
68+
ptep = pmdp_ptep(pmdp);
6969
goto set_the_pte;
7070
}
7171
ptep = pte_alloc_kernel(pmdp, ea);
@@ -90,7 +90,7 @@ int radix__map_kernel_page(unsigned long ea, unsigned long pa,
9090
}
9191
pmdp = pmd_offset(pudp, ea);
9292
if (map_page_size == PMD_SIZE) {
93-
ptep = (pte_t *)pudp;
93+
ptep = pmdp_ptep(pmdp);
9494
goto set_the_pte;
9595
}
9696
if (!pmd_present(*pmdp)) {

0 commit comments

Comments
 (0)