@@ -572,7 +572,7 @@ int osnoise_top_main(int argc, char **argv)
retval = osnoise_top_apply_config(tool, params);
if (retval) {
err_msg("Could not apply config\n");
- goto out_top;
+ goto out_top_pre;
}
trace = &tool->trace;
@@ -580,14 +580,14 @@ int osnoise_top_main(int argc, char **argv)
retval = enable_osnoise(trace);
if (retval) {
err_msg("Failed to enable osnoise tracer\n");
- goto out_top;
+ goto out_top_pre;
}
if (params->set_sched) {
retval = set_comm_sched_attr("osnoise/", ¶ms->sched_param);
if (retval) {
err_msg("Failed to set sched parameters\n");
- goto out_top;
+ goto out_top_pre;
}
}
@@ -597,7 +597,7 @@ int osnoise_top_main(int argc, char **argv)
record = osnoise_init_trace_tool("osnoise");
if (!record) {
err_msg("Failed to enable the trace instance\n");
- goto out_top;
+ goto out_top_pre;
}
if (params->events) {
@@ -648,6 +648,7 @@ int osnoise_top_main(int argc, char **argv)
out_top:
trace_events_destroy(&record->trace, params->events);
+out_top_pre:
params->events = NULL;
osnoise_free_top(tool->data);
osnoise_destroy_tool(record);
record is NULL and go out but dereference record->trace. report by coccicheck: tools/tracing/rtla/src/osnoise_top.c:650:31-36: ERROR: record is NULL but dereferenced. Signed-off-by: Haowen Bai <baihaowen@meizu.com> --- tools/tracing/rtla/src/osnoise_top.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)