aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2016-10-03 10:09:04 -0400
committerSteven Rostedt <rostedt@goodmis.org>2016-10-03 10:09:04 -0400
commit013205a8f9e60998b39c106470957030585b5851 (patch)
treef51936bd6cc9a71beccd41f3367e5e64cd755a0d
parentfca725695474085397339abe07de4a91a781269e (diff)
downloadtrace-cmd-013205a8f9e60998b39c106470957030585b5851.tar.gz
kernelshark: Fix null pointer when next record does not exist
When testing if the plot is in irq context or not, it looks at the current record as well as the next record to see the context. Unfortunately, if the next record does not exist (null is returned) it would cause a crash. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-plot-task.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/trace-plot-task.c b/trace-plot-task.c
index 4343a4c1..5aa0af96 100644
--- a/trace-plot-task.c
+++ b/trace-plot-task.c
@@ -527,7 +527,10 @@ static int task_plot_event(struct graph_info *ginfo,
/* It takes two events to be in an irq */
if (in_irq) {
next_record = tracecmd_peek_data(ginfo->handle, record->cpu);
- in_irq = record_is_interrupt(ginfo, next_record, FALSE);
+ if (next_record)
+ in_irq = record_is_interrupt(ginfo, next_record, FALSE);
+ else
+ in_irq = 0;
}
if (task_info->last_cpu != record->cpu) {