aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/ftrace.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index d073d981a730..8821ceabf51d 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -62,6 +62,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
62 unsigned char *new_code) 62 unsigned char *new_code)
63{ 63{
64 unsigned char replaced[MCOUNT_INSN_SIZE]; 64 unsigned char replaced[MCOUNT_INSN_SIZE];
65 int ret;
65 66
66 /* 67 /*
67 * Note: Due to modules and __init, code can 68 * Note: Due to modules and __init, code can
@@ -77,8 +78,9 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
77 if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) 78 if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0)
78 return 2; 79 return 2;
79 80
80 WARN_ON_ONCE(__copy_to_user_inatomic((char __user *)ip, new_code, 81 ret = __copy_to_user_inatomic((char __user *)ip, new_code,
81 MCOUNT_INSN_SIZE)); 82 MCOUNT_INSN_SIZE);
83 WARN_ON_ONCE(ret);
82 84
83 sync_core(); 85 sync_core();
84 86