2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 20:23:57 +08:00

HID: magicmouse: fix oops after device removal

Ask the HID core not to register an input device for the mouse.
Fix an oops after removing the device, due to leaving the new
input device registered.

Signed-off-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Michael Poole 2010-03-09 06:47:35 -05:00 committed by Jiri Kosina
parent a85821fce2
commit 28918c211d

View File

@ -353,7 +353,7 @@ static int magicmouse_probe(struct hid_device *hdev,
goto err_free; goto err_free;
} }
ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_HIDINPUT);
if (ret) { if (ret) {
dev_err(&hdev->dev, "magicmouse hw start failed\n"); dev_err(&hdev->dev, "magicmouse hw start failed\n");
goto err_free; goto err_free;
@ -409,8 +409,11 @@ err_free:
static void magicmouse_remove(struct hid_device *hdev) static void magicmouse_remove(struct hid_device *hdev)
{ {
struct magicmouse_sc *msc = hid_get_drvdata(hdev);
hid_hw_stop(hdev); hid_hw_stop(hdev);
kfree(hid_get_drvdata(hdev)); input_unregister_device(msc->input);
kfree(msc);
} }
static const struct hid_device_id magic_mice[] = { static const struct hid_device_id magic_mice[] = {