Commit c5138675 authored by Steven Rostedt's avatar Steven Rostedt Committed by Ingo Molnar

ftrace: do not enclose logic in WARN_ON

In ftrace, logic is defined in the WARN_ON_ONCE, which can become a
nop with some configs. This patch fixes it.
Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 3e10e879
...@@ -62,6 +62,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code, ...@@ -62,6 +62,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
unsigned char *new_code) unsigned char *new_code)
{ {
unsigned char replaced[MCOUNT_INSN_SIZE]; unsigned char replaced[MCOUNT_INSN_SIZE];
int ret;
/* /*
* Note: Due to modules and __init, code can * Note: Due to modules and __init, code can
...@@ -77,8 +78,9 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code, ...@@ -77,8 +78,9 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0)
return 2; return 2;
WARN_ON_ONCE(__copy_to_user_inatomic((char __user *)ip, new_code, ret = __copy_to_user_inatomic((char __user *)ip, new_code,
MCOUNT_INSN_SIZE)); MCOUNT_INSN_SIZE);
WARN_ON_ONCE(ret);
sync_core(); sync_core();
......
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