lkml.org 
[lkml]   [2010]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] trace-cmd: Don't SIGSEGV in trace-graph.c:load_handle
Date
This 'fixes' another crash I encountered.  Don't try to dereference
NULL records.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
trace-graph.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/trace-graph.c b/trace-graph.c
index f940874..a53ab84 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -2413,6 +2413,8 @@ static int load_handle(struct graph_info *ginfo,

free_record(record);
record = tracecmd_read_cpu_last(handle, cpu);
+ if (!record)
+ continue;

if (record->ts > ginfo->end_time)
ginfo->end_time = record->ts;
--
1.7.1.1


\
 
 \ /
  Last update: 2010-07-20 02:49    [from the cache]
©2003-2011 Jasper Spaans