HID: bpf: return non NULL data pointer when CONFIG_HID_BPF is not set
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Wed, 16 Nov 2022 10:31:10 +0000 (11:31 +0100)
committerJiri Kosina <jkosina@suse.cz>
Wed, 16 Nov 2022 22:00:20 +0000 (23:00 +0100)
commit576e619ba4a47329bf55ada2d184e72529793fbd
treee7685947bf39519162c650de69e2cd5060f46acb
parentdfae6bec7100ca21a5753a03b09a81174a4e7ba0
HID: bpf: return non NULL data pointer when CONFIG_HID_BPF is not set

dispatch_hid_bpf_device_event() is supposed to return either an error,
or a valid pointer to memory containing the data.

Returning NULL simply makes a segfault when CONFIG_HID_BPF is not set
for any processed event.

Fixes: 658ee5a64fcfbbf ("HID: bpf: allocate data memory for device_event BPF program")
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
include/linux/hid_bpf.h