diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index c9ba49566981..86d8d187f872 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -1007,7 +1007,7 @@ struct map *maps__first(struct maps *maps) return NULL; } -struct map *map__next(struct map *map) +static struct map *__map__next(struct map *map) { struct rb_node *next = rb_next(&map->rb_node); @@ -1016,6 +1016,11 @@ struct map *map__next(struct map *map) return NULL; } +struct map *map__next(struct map *map) +{ + return map ? __map__next(map) : NULL; +} + struct kmap *__map__kmap(struct map *map) { if (!map->dso || !map->dso->kernel)