Skip to content

Commit e6841d3

Browse files
Roderick Colenbrandergregkh
authored andcommitted
HID: sony: Fix memory corruption issue on cleanup.
commit 2bcdacb upstream. 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 <roderick.colenbrander@sony.com> CC: stable@vger.kernel.org Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 02a1385 commit e6841d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)