summaryrefslogtreecommitdiffstats
path: root/arch/arc/mm/fault.c
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2019-05-15 00:10:45 +0200
committerVineet Gupta <vgupta@synopsys.com>2019-07-01 20:02:22 +0200
commit98cb57ad70fb7c8a9c030d3e83fe66b546906e28 (patch)
tree0b287fc5aab7ea2f313379852b53cdd59971528b /arch/arc/mm/fault.c
parentARC: mm: do_page_fault refactor #5: scoot no_context to end (diff)
downloadlinux-98cb57ad70fb7c8a9c030d3e83fe66b546906e28.tar.xz
linux-98cb57ad70fb7c8a9c030d3e83fe66b546906e28.zip
ARC: mm: do_page_fault refactor #6: error handlers to use same pattern
- up_read - if !user_mode - whatever error handling Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/mm/fault.c')
-rw-r--r--arch/arc/mm/fault.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c
index b107e45cce94..2672ce24d741 100644
--- a/arch/arc/mm/fault.c
+++ b/arch/arc/mm/fault.c
@@ -191,22 +191,21 @@ retry:
bad_area:
up_read(&mm->mmap_sem);
- /* User mode accesses just cause a SIGSEGV */
- if (user_mode(regs)) {
- tsk->thread.fault_address = address;
- force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk);
- return;
- }
+ if (!user_mode(regs))
+ goto no_context;
+
+ tsk->thread.fault_address = address;
+ force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk);
+ return;
out_of_memory:
up_read(&mm->mmap_sem);
- if (user_mode(regs)) {
- pagefault_out_of_memory();
- return;
- }
+ if (!user_mode(regs))
+ goto no_context;
- goto no_context;
+ pagefault_out_of_memory();
+ return;
do_sigbus:
up_read(&mm->mmap_sem);