Skip to content
Commit 4fb12519 authored by José Expósito's avatar José Expósito Committed by Jiri Kosina
Browse files

HID: magicmouse: fix crash when disconnecting Magic Trackpad 2



When the Apple Magic Trackpad 2 is connected over USB it registers four
hid_device report descriptors, however, the driver only handles the one
with type HID_TYPE_USBMOUSE and ignores the other three, thus, no driver
data is attached to them.

When the device is disconnected, the remove callback is called for the
four hid_device report descriptors, crashing when the driver data is
NULL.

Check that the driver data is not NULL before using it in the remove
callback.

Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent a4b49409
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment