We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f2d6fd commit 205d74bCopy full SHA for 205d74b
kernel/trace/ftrace.c
@@ -3000,6 +3000,16 @@ int ftrace_startup(struct ftrace_ops *ops, int command)
3000
3001
ftrace_startup_enable(command);
3002
3003
+ /*
3004
+ * If ftrace is in an undefined state, we just remove ops from list
3005
+ * to prevent the NULL pointer, instead of totally rolling it back and
3006
+ * free trampoline, because those actions could cause further damage.
3007
+ */
3008
+ if (unlikely(ftrace_disabled)) {
3009
+ __unregister_ftrace_function(ops);
3010
+ return -ENODEV;
3011
+ }
3012
+
3013
ops->flags &= ~FTRACE_OPS_FL_ADDING;
3014
3015
return 0;
0 commit comments