mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
HID: sony: Fix memory corruption issue on cleanup.
The sony driver is not properly cleaning up from potential failures in sony_input_configured. Currently it calls hid_hw_stop, while hid_connect is still running. This is not a good idea, instead hid_hw_stop should be moved to sony_probe. Similar changes were recently made to Logitech drivers, which were also doing improper cleanup. Signed-off-by: Roderick Colenbrander <[email protected]> CC: [email protected] Signed-off-by: Jiri Kosina <[email protected]>
This commit is contained in:
committed by
Jiri Kosina
parent
b20bef4b4b
commit
2bcdacb703
@@ -2811,7 +2811,6 @@ err_stop:
|
||||
sony_cancel_work_sync(sc);
|
||||
sony_remove_dev_list(sc);
|
||||
sony_release_device_id(sc);
|
||||
hid_hw_stop(hdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2876,6 +2875,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
*/
|
||||
if (!(hdev->claimed & HID_CLAIMED_INPUT)) {
|
||||
hid_err(hdev, "failed to claim input\n");
|
||||
hid_hw_stop(hdev);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user