summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/unaligned_32.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-02-26 16:16:24 -0800
committerDavid S. Miller <davem@davemloft.net>2021-02-26 16:16:24 -0800
commitcf64c2a905e0dabcc473ca70baf275fb3a61fac4 (patch)
tree41600722fc372ef167048622e5959cdf7e458aea /arch/sparc/kernel/unaligned_32.c
parentb9d62433114108eb45d4cae04abccb9b30ac005d (diff)
parent73686e787b495a85551e2e99c459adde6836eb31 (diff)
downloadlinux-cf64c2a905e0dabcc473ca70baf275fb3a61fac4.tar.gz
linux-cf64c2a905e0dabcc473ca70baf275fb3a61fac4.tar.bz2
linux-cf64c2a905e0dabcc473ca70baf275fb3a61fac4.zip
Merge branch 'work.sparc32' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Diffstat (limited to 'arch/sparc/kernel/unaligned_32.c')
-rw-r--r--arch/sparc/kernel/unaligned_32.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c
index 82b60d09ea3c..ef5c5207c9ff 100644
--- a/arch/sparc/kernel/unaligned_32.c
+++ b/arch/sparc/kernel/unaligned_32.c
@@ -16,6 +16,7 @@
#include <linux/uaccess.h>
#include <linux/smp.h>
#include <linux/perf_event.h>
+#include <linux/extable.h>
#include <asm/setup.h>
@@ -213,10 +214,10 @@ static inline int ok_for_kernel(unsigned int insn)
static void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
{
- unsigned long g2 = regs->u_regs [UREG_G2];
- unsigned long fixup = search_extables_range(regs->pc, &g2);
+ const struct exception_table_entry *entry;
- if (!fixup) {
+ entry = search_exception_tables(regs->pc);
+ if (!entry) {
unsigned long address = compute_effective_address(regs, insn);
if(address < PAGE_SIZE) {
printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference in mna handler");
@@ -232,9 +233,8 @@ static void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
die_if_kernel("Oops", regs);
/* Not reached */
}
- regs->pc = fixup;
+ regs->pc = entry->fixup;
regs->npc = regs->pc + 4;
- regs->u_regs [UREG_G2] = g2;
}
asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)