kernelshark: Release input_mutex on not finding record
PATCH 1/1 kernelshark: Release input_mutex on not finding record
From: "Steven Rostedt (Google)" <[email protected]>
The tepdata_get_latency() function could exit without releasing the stream->input_mutex, which would cause a lockup later on.
Fixes 836ce858246b7 ("kernel-shark: Add stream interface for trace-cmd data")
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- src/libkshark-tepdata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
src/libkshark-tepdata.c +3 -1
@@ -793,8 +793,10 @@ static char *tepdata_get_latency(struct kshark_data_stream *stream, record =tracecmd_read_at (kshark_get_tep_input (stream), entry->offset,NULL ); -if (!record) +if (!record) { +pthread_mutex_unlock (&stream->input_mutex);return NULL ; + }trace_seq_reset (&seq); tep_print_event(kshark_get_tep(stream), &seq, record,
Signature · 1 line
2.35.1