projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
HID: roccat: fix NULL pointer dereference, add range checks
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
hid
/
hid-roccat-kone.c
diff --git
a/drivers/hid/hid-roccat-kone.c
b/drivers/hid/hid-roccat-kone.c
index 7e29778fe7ab65ee307ad158f7b7706ba0194b43..2b8f3a31ffb314aa814e560d6fa7c221c9c3035a 100644
(file)
--- a/
drivers/hid/hid-roccat-kone.c
+++ b/
drivers/hid/hid-roccat-kone.c
@@
-832,6
+832,9
@@
static int kone_raw_event(struct hid_device *hdev, struct hid_report *report,
if (size != sizeof(struct kone_mouse_event))
return 0;
+ if (kone == NULL)
+ return 0;
+
/*
* Firmware 1.38 introduced new behaviour for tilt and special buttons.
* Pressed button is reported in each movement event.