Skip to content

Commit

Permalink
perf bench: Fix segfault at the end of an 'all' execution
Browse files Browse the repository at this point in the history
At the end of

  $ perf bench all

the program segfaults because it attempts to dereference a NULL
pointer. Fix this fault.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1395964219-22173-4-git-send-email-artagnon@gmail.com
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
  • Loading branch information
artagnon authored and Jiri Olsa committed Apr 14, 2014
1 parent 95a2b3c commit 5673872
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/builtin-bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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)
{
Expand Down

0 comments on commit 5673872

Please sign in to comment.