mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 03:53:37 +02:00
HID: alps: fix NULL pointer dereference in alps_raw_event()
Commitecfa6f3449("HID: Add HID_CLAIMED_INPUT guards in raw_event callbacks missing them") attempted to fix up the HID drivers that had missed the previous fix that was done in2ff5baa9b5("HID: appleir: Fix potential NULL dereference at raw event handle"), but the alps driver was missed. Fix this up by properly checking in the hid-alps driver that it had been claimed correctly before attempting to process the raw event. Fixes:73196ebe13("HID: alps: add support for Alps T4 Touchpad device") Cc: stable <stable@kernel.org> Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <bentiss@kernel.org> Cc: Masaki Ota <masaki.ota@jp.alps.com> Cc: linux-input@vger.kernel.org Assisted-by: gregkh_clanker_t1000 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
b6a5791285
commit
1badfc4319
|
|
@ -437,6 +437,9 @@ static int alps_raw_event(struct hid_device *hdev,
|
|||
int ret = 0;
|
||||
struct alps_dev *hdata = hid_get_drvdata(hdev);
|
||||
|
||||
if (!(hdev->claimed & HID_CLAIMED_INPUT) || !hdata->input)
|
||||
return 0;
|
||||
|
||||
switch (hdev->product) {
|
||||
case HID_PRODUCT_ID_T4_BTNLESS:
|
||||
ret = t4_raw_event(hdata, data, size);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user