summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/hid/hid_bpf.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2023-01-13 12:09:30 +0300
committerJiri Kosina <jkosina@suse.cz>2023-01-19 00:08:38 +0300
commitd9db1bb55f1032020328ede7a88b2490574646d3 (patch)
tree3d118288ee56919d94ef7c10ac089b2e8e801daa /tools/testing/selftests/hid/hid_bpf.c
parentcea6c4d969bb104d2847e1f4ed708ae0126d6f42 (diff)
downloadlinux-d9db1bb55f1032020328ede7a88b2490574646d3.tar.xz
selftests: hid: ensure the program is correctly pinned
Turns out that if bpffs was not mounted, the test was silently passing. So ensure it passes by checking the mount command result. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'tools/testing/selftests/hid/hid_bpf.c')
-rw-r--r--tools/testing/selftests/hid/hid_bpf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/hid/hid_bpf.c b/tools/testing/selftests/hid/hid_bpf.c
index d215bb492eb4..3b204a15e44b 100644
--- a/tools/testing/selftests/hid/hid_bpf.c
+++ b/tools/testing/selftests/hid/hid_bpf.c
@@ -640,7 +640,8 @@ TEST_F(hid_bpf, test_attach_detach)
/* pin the first program and immediately unpin it */
#define PIN_PATH "/sys/fs/bpf/hid_first_event"
- bpf_program__pin(self->skel->progs.hid_first_event, PIN_PATH);
+ err = bpf_program__pin(self->skel->progs.hid_first_event, PIN_PATH);
+ ASSERT_OK(err) TH_LOG("error while calling bpf_program__pin");
remove(PIN_PATH);
#undef PIN_PATH
usleep(100000);