diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2019-05-14 23:22:47 +0200 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2019-07-01 20:02:22 +0200 |
commit | 450e5b6f654b52bd7495e84cd46dd37d7e184415 (patch) | |
tree | 2f2907e4ff131fc507a19c7284603c1a48e06d57 /arch/arc/mm | |
parent | Linux 5.2-rc7 (diff) | |
download | linux-450e5b6f654b52bd7495e84cd46dd37d7e184415.tar.xz linux-450e5b6f654b52bd7495e84cd46dd37d7e184415.zip |
ARC: mm: do_page_fault refactor #1: remove label @good_area
Invert the condition for stack expansion.
No functional change
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/mm')
-rw-r--r-- | arch/arc/mm/fault.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c index 8cca03480bb2..be8ea91fcc8b 100644 --- a/arch/arc/mm/fault.c +++ b/arch/arc/mm/fault.c @@ -97,21 +97,19 @@ void do_page_fault(unsigned long address, struct pt_regs *regs) flags |= FAULT_FLAG_USER; retry: down_read(&mm->mmap_sem); + vma = find_vma(mm, address); if (!vma) goto bad_area; - if (vma->vm_start <= address) - goto good_area; - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; - if (expand_stack(vma, address)) - goto bad_area; + if (unlikely(address < vma->vm_start)) { + if (!(vma->vm_flags & VM_GROWSDOWN) || expand_stack(vma, address)) + goto bad_area; + } /* * Ok, we have a good vm_area for this memory access, so * we can handle it.. */ -good_area: si_code = SEGV_ACCERR; /* Handle protection violation, execute on heap or stack */ |