diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2022-11-16 11:31:10 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2022-11-16 23:00:20 +0100 |
commit | 576e619ba4a47329bf55ada2d184e72529793fbd (patch) | |
tree | e7685947bf39519162c650de69e2cd5060f46acb | |
parent | Documentation: add HID-BPF docs (diff) | |
download | linux-576e619ba4a47329bf55ada2d184e72529793fbd.tar.xz linux-576e619ba4a47329bf55ada2d184e72529793fbd.zip |
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>
-rw-r--r-- | include/linux/hid_bpf.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/hid_bpf.h b/include/linux/hid_bpf.h index 9b11f8f25ad5..3ca85ab91325 100644 --- a/include/linux/hid_bpf.h +++ b/include/linux/hid_bpf.h @@ -148,7 +148,7 @@ void hid_bpf_device_init(struct hid_device *hid); u8 *call_hid_bpf_rdesc_fixup(struct hid_device *hdev, u8 *rdesc, unsigned int *size); #else /* CONFIG_HID_BPF */ static inline u8 *dispatch_hid_bpf_device_event(struct hid_device *hid, enum hid_report_type type, - u8 *data, u32 *size, int interrupt) { return NULL; } + u8 *data, u32 *size, int interrupt) { return data; } static inline int hid_bpf_connect_device(struct hid_device *hdev) { return 0; } static inline void hid_bpf_disconnect_device(struct hid_device *hdev) {} static inline void hid_bpf_destroy_device(struct hid_device *hid) {} |