Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1574513

[PATCH tip/master 2/2] kprobes: x86: Use hlist_for_each_entry() for first loop

From Masami Hiramatsu <mhiramat@kernel.org>
Newsgroups linux.kernel
Subject [PATCH tip/master 2/2] kprobes: x86: Use hlist_for_each_entry() for first loop
Date 2017-02-06 11:00 +0100
Message-ID <t7Ofw-3hX-23@gated-at.bofh.it> (permalink)
References <t7Ofv-3hX-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Use hlist_for_each_entry() for first loop on kretprobe
trampoline_handler because it doesn't change the hlist.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 arch/x86/kernel/kprobes/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index eb35093..520b8df 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -745,7 +745,7 @@ __visible __used void *trampoline_handler(struct pt_regs *regs)
 	 *	 will be the real return address, and all the rest will
 	 *	 point to kretprobe_trampoline.
 	 */
-	hlist_for_each_entry_safe(ri, tmp, head, hlist) {
+	hlist_for_each_entry(ri, head, hlist) {
 		if (ri->task != current)
 			/* another task is sharing our hash bucket */
 			continue;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH tip/master 0/2] kprobes: trivial cleanups Masami Hiramatsu <mhiramat@kernel.org> - 2017-02-06 11:00 +0100
  [PATCH tip/master 2/2] kprobes: x86: Use hlist_for_each_entry() for first loop Masami Hiramatsu <mhiramat@kernel.org> - 2017-02-06 11:00 +0100
    [tip:perf/core] kprobes/x86: Use hlist_for_each_entry() instead of  hlist_for_each_entry_safe() tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2017-02-06 11:20 +0100

csiph-web