Commit 1aec9e5
committed
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: 4346ba1 ("fprobe: Rewrite fprobe on function-graph tracer")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>1 parent 6ad51ad commit 1aec9e5
1 file changed
Lines changed: 15 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
| 327 | + | |
328 | 328 | | |
329 | | - | |
| 329 | + | |
| 330 | + | |
330 | 331 | | |
331 | 332 | | |
332 | 333 | | |
| |||
525 | 526 | | |
526 | 527 | | |
527 | 528 | | |
528 | | - | |
| 529 | + | |
529 | 530 | | |
530 | | - | |
531 | | - | |
| 531 | + | |
| 532 | + | |
532 | 533 | | |
533 | 534 | | |
534 | 535 | | |
| |||
932 | 933 | | |
933 | 934 | | |
934 | 935 | | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
939 | 944 | | |
940 | 945 | | |
941 | 946 | | |
942 | 947 | | |
943 | | - | |
| 948 | + | |
944 | 949 | | |
945 | 950 | | |
946 | 951 | | |
| |||
0 commit comments