Unverified Commit 59902a3b authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!6835 kprobes: Fix check for probe enabled in kill_kprobe()

parents 9bb9546c f19e20dd
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -2281,6 +2281,14 @@ static void kill_kprobe(struct kprobe *p)
	if (WARN_ON_ONCE(kprobe_gone(p)))
		return;

	/*
	 * The module is going away. We should disarm the kprobe which
	 * is using ftrace, because ftrace framework is still available at
	 * MODULE_STATE_GOING notification.
	 */
	if (kprobe_ftrace(p) && !kprobe_disabled(p) && !kprobes_all_disarmed)
		disarm_kprobe_ftrace(p);

	p->flags |= KPROBE_FLAG_GONE;
	if (kprobe_aggrprobe(p)) {
		/*
@@ -2297,14 +2305,6 @@ static void kill_kprobe(struct kprobe *p)
	 * the original probed function (which will be freed soon) any more.
	 */
	arch_remove_kprobe(p);

	/*
	 * The module is going away. We should disarm the kprobe which
	 * is using ftrace, because ftrace framework is still available at
	 * MODULE_STATE_GOING notification.
	 */
	if (kprobe_ftrace(p) && !kprobe_disabled(p) && !kprobes_all_disarmed)
		disarm_kprobe_ftrace(p);
}

/* Disable one kprobe */