perf bench: Fix NULL pointer dereference in "perf bench all"
[profile/ivi/kernel-x86-ivi.git] / tools / perf / builtin-bench.c
index e47f90c..8a987d2 100644 (file)
@@ -76,7 +76,7 @@ static struct collection collections[] = {
 
 /* Iterate over all benchmarks within a collection: */
 #define for_each_bench(coll, bench) \
-       for (bench = coll->benchmarks; bench->name; bench++)
+       for (bench = coll->benchmarks; bench && bench->name; bench++)
 
 static void dump_benchmarks(struct collection *coll)
 {