arch/arm64/mm/fault: Fix undeclared variable error in do_page_fault()
Subsystems (2)
PATCH 1/1 arch/arm64/mm/fault: Fix undeclared variable error in do_page_fault()
Commit ae870a68b5d1 ("arm64/mm: Convert to using lock_mm_and_find_vma()") made do_page_fault() to use 'vma' even if CONFIG_PER_VMA_LOCK is not defined, but the declaration is still in the ifdef. As a result, building kernel without the config fails with undeclared variable error as below:
arch/arm64/mm/fault.c: In function 'do_page_fault':
arch/arm64/mm/fault.c:624:2: error: 'vma' undeclared (first use in this function); did you mean 'vmap'?
624 | vma = lock_mm_and_find_vma(mm, addr, regs);
| ^~~
| vmap
Fix it by moving the declaration out of the ifdef.
--- arch/arm64/mm/fault.c | 2 -- 1 file changed, 2 deletions(-)
arch/arm64/mm/fault.c +0 -2
@@ -536,9 +536,7 @@ static int __kprobes do_page_fault(unsigned long far, unsigned long esr,unsigned long vm_flags;unsigned int mm_flags =FAULT_FLAG_DEFAULT ;unsigned long addr =untagged_addr (far); -#ifdef CONFIG_PER_VMA_LOCK struct vm_area_struct *vma; -#endif if (kprobe_page_fault (regs, esr))return 0 ;
Signature · 1 line
2.25.1
Quoted 5 lines · SeongJae Park
Commit
ae870a68b5d1("arm64/mm: Convert to usinglock_mm_and_find_vma()") madedo_page_fault()to use 'vma' even ifCONFIG_PER_VMA_LOCKis not defined, but the declaration is still in the ifdef.
Duh. Thanks. Applied.
Linus