Commit 63af5262 authored by Anton Blanchard's avatar Anton Blanchard Committed by Michael Ellerman

powerpc: Simplify do_sigbus

Exit out early for a kernel fault, avoiding indenting of
most of the function.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent e35735b9
...@@ -120,7 +120,9 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address) ...@@ -120,7 +120,9 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address)
up_read(&current->mm->mmap_sem); up_read(&current->mm->mmap_sem);
if (user_mode(regs)) { if (!user_mode(regs))
return MM_FAULT_ERR(SIGBUS);
current->thread.trap_nr = BUS_ADRERR; current->thread.trap_nr = BUS_ADRERR;
info.si_signo = SIGBUS; info.si_signo = SIGBUS;
info.si_errno = 0; info.si_errno = 0;
...@@ -128,8 +130,6 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address) ...@@ -128,8 +130,6 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address)
info.si_addr = (void __user *)address; info.si_addr = (void __user *)address;
force_sig_info(SIGBUS, &info, current); force_sig_info(SIGBUS, &info, current);
return MM_FAULT_RETURN; return MM_FAULT_RETURN;
}
return MM_FAULT_ERR(SIGBUS);
} }
static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault) static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)
......
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