diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gen_bpf.c | 3 | ||||
-rw-r--r-- | src/gen_pfc.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/gen_bpf.c b/src/gen_bpf.c index c878f44..7131761 100644 --- a/src/gen_bpf.c +++ b/src/gen_bpf.c @@ -1348,6 +1348,9 @@ static int _get_bintree_levels(unsigned int syscall_cnt) { unsigned int i = 2, max_level = SYSCALLS_PER_NODE * 2; + if (syscall_cnt == 0) + return 0; + while (max_level < syscall_cnt) { max_level <<= 1; i++; diff --git a/src/gen_pfc.c b/src/gen_pfc.c index c7fb536..4916055 100644 --- a/src/gen_pfc.c +++ b/src/gen_pfc.c @@ -275,6 +275,9 @@ static int _get_bintree_levels(unsigned int syscall_cnt, /* Only use a binary tree if requested */ return 0; + if (syscall_cnt == 0) + return 0; + do { max_level = SYSCALLS_PER_NODE << i; i++; |