Commit 450e5b6f authored by Vineet Gupta's avatar Vineet Gupta

ARC: mm: do_page_fault refactor #1: remove label @good_area

Invert the condition for stack expansion.
No functional change
Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
parent 6fbc7275
...@@ -97,21 +97,19 @@ void do_page_fault(unsigned long address, struct pt_regs *regs) ...@@ -97,21 +97,19 @@ void do_page_fault(unsigned long address, struct pt_regs *regs)
flags |= FAULT_FLAG_USER; flags |= FAULT_FLAG_USER;
retry: retry:
down_read(&mm->mmap_sem); down_read(&mm->mmap_sem);
vma = find_vma(mm, address); vma = find_vma(mm, address);
if (!vma) if (!vma)
goto bad_area; goto bad_area;
if (vma->vm_start <= address) if (unlikely(address < vma->vm_start)) {
goto good_area; if (!(vma->vm_flags & VM_GROWSDOWN) || expand_stack(vma, address))
if (!(vma->vm_flags & VM_GROWSDOWN))
goto bad_area;
if (expand_stack(vma, address))
goto bad_area; goto bad_area;
}
/* /*
* Ok, we have a good vm_area for this memory access, so * Ok, we have a good vm_area for this memory access, so
* we can handle it.. * we can handle it..
*/ */
good_area:
si_code = SEGV_ACCERR; si_code = SEGV_ACCERR;
/* Handle protection violation, execute on heap or stack */ /* Handle protection violation, execute on heap or stack */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment