summaryrefslogtreecommitdiff
path: root/tools/perf/util/unwind.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/unwind.c')
-rw-r--r--tools/perf/util/unwind.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/unwind.c b/tools/perf/util/unwind.c
index 742f23bf35ff..bff3209305e1 100644
--- a/tools/perf/util/unwind.c
+++ b/tools/perf/util/unwind.c
@@ -595,5 +595,5 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
if (ret)
return -ENOMEM;
- return get_entries(&ui, cb, arg, max_stack);
+ return --max_stack > 0 ? get_entries(&ui, cb, arg, max_stack) : 0;
}