summaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-03-11 17:54:59 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2020-03-11 17:54:59 +0100
commit36feb996308ec3392495e3341bab2570b11cb1bd (patch)
tree311449231513733558e0e7976fea2d5ecd366e22 /kernel/trace
parentMerge tag 'mips_fixes_5.6.1' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff)
parentftrace: Return the first found result in lookup_rec() (diff)
downloadlinux-36feb996308ec3392495e3341bab2570b11cb1bd.tar.xz
linux-36feb996308ec3392495e3341bab2570b11cb1bd.zip
Merge tag 'trace-v5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull ftrace fix from Steven Rostedt: "Have ftrace lookup_rec() return a consistent record otherwise it can break live patching" * tag 'trace-v5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: ftrace: Return the first found result in lookup_rec()
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/ftrace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 3f7ee102868a..fd81c7de77a7 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1547,6 +1547,8 @@ static struct dyn_ftrace *lookup_rec(unsigned long start, unsigned long end)
rec = bsearch(&key, pg->records, pg->index,
sizeof(struct dyn_ftrace),
ftrace_cmp_recs);
+ if (rec)
+ break;
}
return rec;
}