Skip to content

Commit 494b332

Browse files
committed
tracing/eprobe: Fix to release eprobe when failed to add dyn_event
Fix eprobe event to unregister event call and release eprobe when it fails to add dynamic event correctly. Link: https://lore.kernel.org/all/173289886698.73724.1959899350183686006.stgit@devnote2/ Fixes: 7491e2c ("tracing: Add a probe that attaches to trace events") Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
1 parent 40384c8 commit 494b332

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kernel/trace/trace_eprobe.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,11 @@ static int __trace_eprobe_create(int argc, const char *argv[])
963963
goto error;
964964
}
965965
ret = dyn_event_add(&ep->devent, &ep->tp.event->call);
966+
if (ret < 0) {
967+
trace_probe_unregister_event_call(&ep->tp);
968+
mutex_unlock(&event_mutex);
969+
goto error;
970+
}
966971
mutex_unlock(&event_mutex);
967972
return ret;
968973
parse_error:

0 commit comments

Comments
 (0)