diff --git a/tools/perf/util/dsos.c b/tools/perf/util/dsos.c index 846828ea1f00..5e5e05f86dd3 100644 --- a/tools/perf/util/dsos.c +++ b/tools/perf/util/dsos.c @@ -164,6 +164,9 @@ static struct dso *__dsos__find_by_longname_id(struct dsos *dsos, }; struct dso **res; + if (dsos->dsos == NULL) + return NULL; + if (!dsos->sorted) { if (!write_locked) { struct dso *dso;