diff options
author | Stefan Achatz <erazor_de@users.sourceforge.net> | 2011-06-12 10:02:44 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-06-13 13:06:23 +0200 |
commit | 901e64dbdb5998b9248c372a401c921bbdf662f6 (patch) | |
tree | 439c7685adb52e2b97b968ee6535da29a8434915 /drivers/hid/hid-roccat-kone.c | |
parent | HID: roccat: correction and cleanup of HID feature reports (diff) | |
download | linux-901e64dbdb5998b9248c372a401c921bbdf662f6.tar.xz linux-901e64dbdb5998b9248c372a401c921bbdf662f6.zip |
HID: roccat: fix NULL pointer dereference, add range checks
On rare occassions raw events can be triggered before drvdata gets set up
which leads to NULL pointer dereferences. This was only observed with pyra on
2.6.39, but is fixed for all devices now to play it save.
kovaplus returned wrong actual values when profile change was initiated from host.
Added range checks for setting actual profile on all devices.
Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-roccat-kone.c')
-rw-r--r-- | drivers/hid/hid-roccat-kone.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index 7e29778fe7ab..2b8f3a31ffb3 100644 --- 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. |