Commit 98cb57ad authored by Vineet Gupta's avatar Vineet Gupta

ARC: mm: do_page_fault refactor #6: error handlers to use same pattern

 - up_read
 - if !user_mode
 - whatever error handling
Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
parent d0542c7e
...@@ -191,22 +191,21 @@ void do_page_fault(unsigned long address, struct pt_regs *regs) ...@@ -191,22 +191,21 @@ void do_page_fault(unsigned long address, struct pt_regs *regs)
bad_area: bad_area:
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
/* User mode accesses just cause a SIGSEGV */ if (!user_mode(regs))
if (user_mode(regs)) { goto no_context;
tsk->thread.fault_address = address;
force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk); tsk->thread.fault_address = address;
return; force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk);
} return;
out_of_memory: out_of_memory:
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
if (user_mode(regs)) { if (!user_mode(regs))
pagefault_out_of_memory(); goto no_context;
return;
}
goto no_context; pagefault_out_of_memory();
return;
do_sigbus: do_sigbus:
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
......
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