diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 287b263c9cb957..7557883771f91f 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -1088,6 +1088,9 @@ static int __disarm_kprobe_ftrace(struct kprobe *p, struct ftrace_ops *ops, { int ret = 0; + if (kprobe_disabled(p)) + return ret; + if (*cnt == 1) { ret = unregister_ftrace_function(ops); if (WARN(ret < 0, "Failed to unregister kprobe-ftrace (%d)\n", ret))