mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
e35735b9a5
commit
63af52629a
|
@ -120,16 +120,16 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address)
|
||||||
|
|
||||||
up_read(¤t->mm->mmap_sem);
|
up_read(¤t->mm->mmap_sem);
|
||||||
|
|
||||||
if (user_mode(regs)) {
|
if (!user_mode(regs))
|
||||||
current->thread.trap_nr = BUS_ADRERR;
|
return MM_FAULT_ERR(SIGBUS);
|
||||||
info.si_signo = SIGBUS;
|
|
||||||
info.si_errno = 0;
|
current->thread.trap_nr = BUS_ADRERR;
|
||||||
info.si_code = BUS_ADRERR;
|
info.si_signo = SIGBUS;
|
||||||
info.si_addr = (void __user *)address;
|
info.si_errno = 0;
|
||||||
force_sig_info(SIGBUS, &info, current);
|
info.si_code = BUS_ADRERR;
|
||||||
return MM_FAULT_RETURN;
|
info.si_addr = (void __user *)address;
|
||||||
}
|
force_sig_info(SIGBUS, &info, current);
|
||||||
return MM_FAULT_ERR(SIGBUS);
|
return MM_FAULT_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
|
|
Loading…
Reference in New Issue