File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -4910,28 +4910,30 @@ pte_t *huge_pte_offset(struct mm_struct *mm,
4910
4910
{
4911
4911
pgd_t * pgd ;
4912
4912
p4d_t * p4d ;
4913
- pud_t * pud ;
4914
- pmd_t * pmd ;
4913
+ pud_t * pud , pud_entry ;
4914
+ pmd_t * pmd , pmd_entry ;
4915
4915
4916
4916
pgd = pgd_offset (mm , addr );
4917
- if (!pgd_present (* pgd ))
4917
+ if (!pgd_present (READ_ONCE ( * pgd ) ))
4918
4918
return NULL ;
4919
4919
p4d = p4d_offset (pgd , addr );
4920
- if (!p4d_present (* p4d ))
4920
+ if (!p4d_present (READ_ONCE ( * p4d ) ))
4921
4921
return NULL ;
4922
4922
4923
4923
pud = pud_offset (p4d , addr );
4924
- if (sz != PUD_SIZE && pud_none (* pud ))
4924
+ pud_entry = READ_ONCE (* pud );
4925
+ if (sz != PUD_SIZE && pud_none (pud_entry ))
4925
4926
return NULL ;
4926
4927
/* hugepage or swap? */
4927
- if (pud_huge (* pud ) || !pud_present (* pud ))
4928
+ if (pud_huge (pud_entry ) || !pud_present (pud_entry ))
4928
4929
return (pte_t * )pud ;
4929
4930
4930
4931
pmd = pmd_offset (pud , addr );
4931
- if (sz != PMD_SIZE && pmd_none (* pmd ))
4932
+ pmd_entry = READ_ONCE (* pmd );
4933
+ if (sz != PMD_SIZE && pmd_none (pmd_entry ))
4932
4934
return NULL ;
4933
4935
/* hugepage or swap? */
4934
- if (pmd_huge (* pmd ) || !pmd_present (* pmd ))
4936
+ if (pmd_huge (pmd_entry ) || !pmd_present (pmd_entry ))
4935
4937
return (pte_t * )pmd ;
4936
4938
4937
4939
return NULL ;
You can’t perform that action at this time.
0 commit comments