]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tracing/fprobe: Unregister fprobe even if memory allocation fails
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Mon, 20 Apr 2026 14:00:56 +0000 (23:00 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 21 Apr 2026 14:59:39 +0000 (23:59 +0900)
commit1aec9e5c3e31ce1e28f914427fb7f90b91d310df
treecc8431dd5a602e8441ce10bae61d716f26618529
parent6ad51ada17ed80c9a5f205b4c01c424cac8b0d46
tracing/fprobe: Unregister fprobe even if memory allocation fails

unregister_fprobe() can fail under memory pressure because of memory
allocation failure, but this maybe called from module unloading, and
usually there is no way to retry it. Moreover. trace_fprobe does not
check the return value.

To fix this problem, unregister fprobe and fprobe_hash_node even if
working memory allocation fails.
Anyway, if the last fprobe is removed, the filter will be freed.

Link: https://lore.kernel.org/all/177669365629.132053.8433032896213721288.stgit@mhiramat.tok.corp.google.com/
Fixes: 4346ba160409 ("fprobe: Rewrite fprobe on function-graph tracer")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
kernel/trace/fprobe.c