selftests: hid: attach/detach 2 bpf programs, not just one
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Fri, 13 Jan 2023 09:09:29 +0000 (10:09 +0100)
committerJiri Kosina <jkosina@suse.cz>
Wed, 18 Jan 2023 21:08:38 +0000 (22:08 +0100)
commitcea6c4d969bb104d2847e1f4ed708ae0126d6f42
treed36189beb19b76448ebdbd71c0173b4b79916e19
parent633ba3be76426056a047b2a355082d94afa9230d
selftests: hid: attach/detach 2 bpf programs, not just one

Add a second BPF program to attach to the device, as the development of
this feature showed that we also need to ensure we can detach multiple
programs to a device (hid_bpf_link->hid_table_index was actually not set
initially, and this lead to any BPF program not being released except for
the first one).

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
tools/testing/selftests/hid/hid_bpf.c
tools/testing/selftests/hid/progs/hid.c