]> www.infradead.org Git - users/jedix/linux-maple.git/commit
uprobes: Decouple return_instance list traversal and freeing
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 6 Dec 2024 00:24:15 +0000 (16:24 -0800)
committerIngo Molnar <mingo@kernel.org>
Mon, 9 Dec 2024 14:50:26 +0000 (15:50 +0100)
commit636666a1c73313a0cc9a0a6671c29e2d6ebe16fb
tree656ac1ddb331d8b00bce7898d7609907db809d40
parent2ff913ab3f472321ac1931b663314edd6c211a0c
uprobes: Decouple return_instance list traversal and freeing

free_ret_instance() has two unrelated responsibilities: actually
cleaning up return_instance's resources and freeing memory, and also
helping with utask->return_instances list traversal by returning the
next alive pointer.

There is no reason why these two aspects have to be mixed together, so
turn free_ret_instance() into void-returning function and make callers
do list traversal on their own.

We'll use this simplification in the next patch that will guarantee that
to-be-freed return_instance isn't reachable from utask->return_instances
list.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Link: https://lore.kernel.org/r/20241206002417.3295533-3-andrii@kernel.org
kernel/events/uprobes.c