summaryrefslogtreecommitdiffstats
path: root/arch/arc
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2019-05-14 17:22:47 -0400
committerVineet Gupta <vgupta@synopsys.com>2019-07-01 14:02:22 -0400
commit450e5b6f654b52bd7495e84cd46dd37d7e184415 (patch)
tree2f2907e4ff131fc507a19c7284603c1a48e06d57 /arch/arc
parent6fbc7275c7a9ba97877050335f290341a1fd8dbf (diff)
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')
-rw-r--r--arch/arc/mm/fault.c12
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)
97 flags |= FAULT_FLAG_USER; 97 flags |= FAULT_FLAG_USER;
98retry: 98retry:
99 down_read(&mm->mmap_sem); 99 down_read(&mm->mmap_sem);
100
100 vma = find_vma(mm, address); 101 vma = find_vma(mm, address);
101 if (!vma) 102 if (!vma)
102 goto bad_area; 103 goto bad_area;
103 if (vma->vm_start <= address) 104 if (unlikely(address < vma->vm_start)) {
104 goto good_area; 105 if (!(vma->vm_flags & VM_GROWSDOWN) || expand_stack(vma, address))
105 if (!(vma->vm_flags & VM_GROWSDOWN)) 106 goto bad_area;
106 goto bad_area; 107 }
107 if (expand_stack(vma, address))
108 goto bad_area;
109 108
110 /* 109 /*
111 * Ok, we have a good vm_area for this memory access, so 110 * Ok, we have a good vm_area for this memory access, so
112 * we can handle it.. 111 * we can handle it..
113 */ 112 */
114good_area:
115 si_code = SEGV_ACCERR; 113 si_code = SEGV_ACCERR;
116 114
117 /* Handle protection violation, execute on heap or stack */ 115 /* Handle protection violation, execute on heap or stack */