From 65da552f6e61a7b75d8594fc7355eeed2c919063 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Thu, 24 Jan 2013 16:10:42 -0300 Subject: [PATCH] --- yaml --- r: 349984 b: refs/heads/master c: 5a3d04d6dc9050b4b4562f5c66aea23f0aa1c003 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/util/intlist.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index a241eacf9cd9..01995a66fa07 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1de7b7e89d16e3daf32fb3b6f214d038ab2ed879 +refs/heads/master: 5a3d04d6dc9050b4b4562f5c66aea23f0aa1c003 diff --git a/trunk/tools/perf/util/intlist.c b/trunk/tools/perf/util/intlist.c index 9d0740024ba8..cbf0c32ce403 100644 --- a/trunk/tools/perf/util/intlist.c +++ b/trunk/tools/perf/util/intlist.c @@ -59,9 +59,14 @@ void intlist__remove(struct intlist *ilist, struct int_node *node) struct int_node *intlist__find(struct intlist *ilist, int i) { - struct int_node *node = NULL; - struct rb_node *rb_node = rblist__find(&ilist->rblist, (void *)((long)i)); + struct int_node *node; + struct rb_node *rb_node; + + if (ilist == NULL) + return NULL; + node = NULL; + rb_node = rblist__find(&ilist->rblist, (void *)((long)i)); if (rb_node) node = container_of(rb_node, struct int_node, rb_node);