Commit ac91052
committed
tracing: tprobe-events: Fix leakage of module refcount
When enabling the tracepoint at loading module, the target module
refcount is incremented by find_tracepoint_in_module(). But it is
unnecessary because the module is not unloaded while processing
module loading callbacks.
Moreover, the refcount is not decremented in that function.
To be clear the module refcount handling, move the try_module_get()
callsite to trace_fprobe_create_internal(), where it is actually
required.
Link: https://lore.kernel.org/all/174182761071.83274.18334217580449925882.stgit@devnote2/
Fixes: 57a7e6d ("tracing/fprobe: Support raw tracepoints on future loaded modules")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: stable@vger.kernel.org1 parent 0a8bb68 commit ac91052
1 file changed
Lines changed: 8 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
920 | 920 | | |
921 | 921 | | |
922 | 922 | | |
923 | | - | |
| 923 | + | |
924 | 924 | | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | 925 | | |
931 | 926 | | |
932 | 927 | | |
| |||
938 | 933 | | |
939 | 934 | | |
940 | 935 | | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
| 936 | + | |
948 | 937 | | |
949 | 938 | | |
950 | 939 | | |
| |||
973 | 962 | | |
974 | 963 | | |
975 | 964 | | |
| 965 | + | |
976 | 966 | | |
977 | 967 | | |
978 | 968 | | |
| |||
1179 | 1169 | | |
1180 | 1170 | | |
1181 | 1171 | | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1182 | 1177 | | |
1183 | 1178 | | |
1184 | 1179 | | |
| |||
0 commit comments