mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-07 00:59:06 +00:00
rtla: Fix double free
[ Upstream commit4f753c3be5
] Avoid double free by making trace_instance_destroy indempotent. When trace_instance_init fails, it calls trace_instance_destroy, but its only caller osnoise_destroy_tool calls it again. Link: https://lkml.kernel.org/r/mvmilnlkyzx.fsf_-_@suse.de Fixes:0605bf009f
("rtla: Add osnoise tool") Signed-off-by: Andreas Schwab <schwab@suse.de> Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4927a4161c
commit
b737d48db8
1 changed files with 7 additions and 2 deletions
|
@ -134,13 +134,18 @@ void trace_instance_destroy(struct trace_instance *trace)
|
||||||
if (trace->inst) {
|
if (trace->inst) {
|
||||||
disable_tracer(trace->inst);
|
disable_tracer(trace->inst);
|
||||||
destroy_instance(trace->inst);
|
destroy_instance(trace->inst);
|
||||||
|
trace->inst = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trace->seq)
|
if (trace->seq) {
|
||||||
free(trace->seq);
|
free(trace->seq);
|
||||||
|
trace->seq = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (trace->tep)
|
if (trace->tep) {
|
||||||
tep_free(trace->tep);
|
tep_free(trace->tep);
|
||||||
|
trace->tep = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue