diff options
author | Anton Blanchard <anton@samba.org> | 2014-09-24 02:59:56 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2014-10-02 03:15:09 -0400 |
commit | 63af52629adcd1313c7db252f085263012ecd9db (patch) | |
tree | df5ebd131aab516a35aa78a557696fe03af721c0 /arch/powerpc/mm | |
parent | e35735b9a5d8d38d9ffe2f1f0cdcbb0d45c42eff (diff) |
powerpc: Simplify do_sigbus
Exit out early for a kernel fault, avoiding indenting of
most of the function.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/fault.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 51ab9e7e6c39..abc8c816a326 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c | |||
@@ -120,16 +120,16 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address) | |||
120 | 120 | ||
121 | up_read(¤t->mm->mmap_sem); | 121 | up_read(¤t->mm->mmap_sem); |
122 | 122 | ||
123 | if (user_mode(regs)) { | 123 | if (!user_mode(regs)) |
124 | current->thread.trap_nr = BUS_ADRERR; | 124 | return MM_FAULT_ERR(SIGBUS); |
125 | info.si_signo = SIGBUS; | 125 | |
126 | info.si_errno = 0; | 126 | current->thread.trap_nr = BUS_ADRERR; |
127 | info.si_code = BUS_ADRERR; | 127 | info.si_signo = SIGBUS; |
128 | info.si_addr = (void __user *)address; | 128 | info.si_errno = 0; |
129 | force_sig_info(SIGBUS, &info, current); | 129 | info.si_code = BUS_ADRERR; |
130 | return MM_FAULT_RETURN; | 130 | info.si_addr = (void __user *)address; |
131 | } | 131 | force_sig_info(SIGBUS, &info, current); |
132 | return MM_FAULT_ERR(SIGBUS); | 132 | return MM_FAULT_RETURN; |
133 | } | 133 | } |
134 | 134 | ||
135 | static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault) | 135 | static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault) |