From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> 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) <rostedt@xxxxxxxxxxx> --- src/libkshark-tepdata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c index e9244b0761bb..08aca0989a59 100644 --- a/src/libkshark-tepdata.c +++ b/src/libkshark-tepdata.c @@ -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, -- 2.35.1