HID: alps: fix NULL pointer dereference in alps_raw_event()
PATCH 1/1 HID: alps: fix NULL pointer dereference in alps_raw_event()
Commit ecfa6f34492c ("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 in 2ff5baa9b527 ("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.
--- drivers/hid/hid-alps.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/hid/hid-alps.c +3 -0
@@ -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);
Signature · 1 line
2.53.0
Quoted 9 lines · Greg Kroah-Hartman
Commit
ecfa6f34492c("HID: AddHID_CLAIMED_INPUTguards inraw_eventcallbacks missing them") attempted to fix up the HID drivers that had missed the previous fix that was done in2ff5baa9b527("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.
Quoted 8 lines
Fixes 73196ebe134d ("HID: alps: add support for Alps T4 Touchpad device")Cc stable <[email protected]>Cc Jiri Kosina <[email protected]>Cc Benjamin Tissoires <[email protected]>Cc Masaki Ota <[email protected]>Assisted-by gregkh_clanker_t1000Signed-off-by Greg Kroah-Hartman <[email protected]>
Applied, thanks.
Signature · 2 lines
Jiri Kosina SUSE Labs