Skip to content

Commit 2bcdacb

Browse files
Roderick ColenbranderJiri Kosina
authored andcommitted
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]>
1 parent b20bef4 commit 2bcdacb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hid-sony.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2811,7 +2811,6 @@ static int sony_input_configured(struct hid_device *hdev,
28112811
sony_cancel_work_sync(sc);
28122812
sony_remove_dev_list(sc);
28132813
sony_release_device_id(sc);
2814-
hid_hw_stop(hdev);
28152814
return ret;
28162815
}
28172816

@@ -2876,6 +2875,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
28762875
*/
28772876
if (!(hdev->claimed & HID_CLAIMED_INPUT)) {
28782877
hid_err(hdev, "failed to claim input\n");
2878+
hid_hw_stop(hdev);
28792879
return -ENODEV;
28802880
}
28812881

0 commit comments

Comments
 (0)