summaryrefslogtreecommitdiff
path: root/sysdeps/s390/s390-32/backtrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/s390/s390-32/backtrace.c')
-rw-r--r--sysdeps/s390/s390-32/backtrace.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/s390/s390-32/backtrace.c b/sysdeps/s390/s390-32/backtrace.c
index 73db65275d..4e5e1feee6 100644
--- a/sysdeps/s390/s390-32/backtrace.c
+++ b/sysdeps/s390/s390-32/backtrace.c
@@ -126,6 +126,10 @@ int
__backtrace (void **array, int size)
{
struct trace_arg arg = { .array = array, .size = size, .cnt = -1 };
+
+ if (size <= 0)
+ return 0;
+
#ifdef SHARED
__libc_once_define (static, once);
@@ -135,8 +139,7 @@ __backtrace (void **array, int size)
return __backchain_backtrace (array, size);
#endif
- if (size >= 1)
- unwind_backtrace (backtrace_helper, &arg);
+ unwind_backtrace (backtrace_helper, &arg);
return arg.cnt != -1 ? arg.cnt : 0;
}