Commit 559d8d91 authored by Eric W. Biederman's avatar Eric W. Biederman

signal/arm64: Only call set_thread_esr once in do_page_fault

This code is truly common between the signal sending cases so share it.
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Tested-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
parent 2d2837fa
......@@ -564,6 +564,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
}
inf = esr_to_fault_info(esr);
set_thread_esr(addr, esr);
if (fault & VM_FAULT_SIGBUS) {
/*
* We had some memory, but were unable to successfully fix up
......@@ -573,7 +574,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
si.si_signo = SIGBUS;
si.si_code = BUS_ADRERR;
si.si_addr = (void __user *)addr;
set_thread_esr(addr, esr);
arm64_force_sig_info(&si, inf->name);
} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
unsigned int lsb;
......@@ -587,7 +587,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
si.si_code = BUS_MCEERR_AR;
si.si_addr = (void __user *)addr;
si.si_addr_lsb = lsb;
set_thread_esr(addr, esr);
arm64_force_sig_info(&si, inf->name);
} else {
/*
......@@ -599,7 +598,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
si.si_code = fault == VM_FAULT_BADACCESS ?
SEGV_ACCERR : SEGV_MAPERR;
si.si_addr = (void __user *)addr;
set_thread_esr(addr, esr);
arm64_force_sig_info(&si, inf->name);
}
......
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