summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2023-01-13 10:09:30 +0100
committerJiri Kosina <jkosina@suse.cz>2023-01-18 22:08:38 +0100
commitd9db1bb55f1032020328ede7a88b2490574646d3 (patch)
tree3d118288ee56919d94ef7c10ac089b2e8e801daa /tools/testing/selftests/hid
parentcea6c4d969bb104d2847e1f4ed708ae0126d6f42 (diff)
downloadlinux-stable-d9db1bb55f1032020328ede7a88b2490574646d3.tar.gz
linux-stable-d9db1bb55f1032020328ede7a88b2490574646d3.tar.bz2
linux-stable-d9db1bb55f1032020328ede7a88b2490574646d3.zip
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')
-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);