selftests/bpf: Fix return value checks in perf_event_stackmap test
authorYuntao Wang <ytcoode@gmail.com>
Fri, 8 Apr 2022 04:14:52 +0000 (12:14 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 8 Apr 2022 20:38:17 +0000 (22:38 +0200)
commit658d87687cd5a6c8762d1de8abee1e6792d8d71e
treef8e4b4ae42548cec1a14f8c8efd30046203a84c2
parent8555defe48610a7efe9f2d72689e2d4f006898d7
selftests/bpf: Fix return value checks in perf_event_stackmap test

The bpf_get_stackid() function may also return 0 on success as per UAPI BPF
helper documentation. Therefore, correct checks from 'val > 0' to 'val >= 0'
to ensure that they cover all possible success return values.

Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220408041452.933944-1-ytcoode@gmail.com
tools/testing/selftests/bpf/progs/perf_event_stackmap.c