summaryrefslogtreecommitdiff
path: root/arch/loongarch/lib/error-inject.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/loongarch/lib/error-inject.c')
-rw-r--r--arch/loongarch/lib/error-inject.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/loongarch/lib/error-inject.c b/arch/loongarch/lib/error-inject.c
new file mode 100644
index 000000000000..afc9e1c7c973
--- /dev/null
+++ b/arch/loongarch/lib/error-inject.c
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/error-injection.h>
+#include <linux/kprobes.h>
+
+void override_function_with_return(struct pt_regs *regs)
+{
+ instruction_pointer_set(regs, regs->regs[1]);
+}
+NOKPROBE_SYMBOL(override_function_with_return);