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>
This commit is contained in:
Vineet Gupta 2019-05-14 15:10:45 -07:00
parent d0542c7eac
commit 98cb57ad70

View File

@ -191,22 +191,21 @@ void do_page_fault(unsigned long address, struct pt_regs *regs)
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);