Skip to content
Commit 4b4f6cec authored by Johan Hovold's avatar Johan Hovold Committed by Jiri Kosina
Browse files

HID: magicmouse: fix NULL-deref on disconnect

Commit 9d7b1866

 ("HID: magicmouse: add support for Apple Magic
Trackpad 2") added a sanity check for an Apple trackpad but returned
success instead of -ENODEV when the check failed. This means that the
remove callback will dereference the never-initialised driver data
pointer when the driver is later unbound (e.g. on USB disconnect).

Reported-by: default avatar <syzbot+ee6f6e2e68886ca256a8@syzkaller.appspotmail.com>
Fixes: 9d7b1866

 ("HID: magicmouse: add support for Apple Magic Trackpad 2")
Cc: stable@vger.kernel.org      # 4.20
Cc: Claudio Mettler <claudio@ponyfleisch.ch>
Cc: Marek Wyborski <marek.wyborski@emwesoft.com>
Cc: Sean O'Brien <seobrien@chromium.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 22db5e00
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