diff options
| author | Roderick Colenbrander <roderick.colenbrander@sony.com> | 2019-09-04 14:22:11 -0700 |
|---|---|---|
| committer | Siarhei Vishniakou <svv@google.com> | 2019-11-08 10:13:30 -0600 |
| commit | 178a0b27a591fd3a2a04eebfac5faa5c620eb37b (patch) | |
| tree | efcadc1c3185e6169bc12be2cda1f8e1fa17125a /drivers/hid | |
| parent | 2a0af931638da37736975f6ad649c5297a3f18f5 (diff) | |
UPSTREAM: 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 <roderick.colenbrander@sony.com>
CC: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Bug: 139372370
Change-Id: I97dadab125a6a426763efd3beb939ddca017c6b6
(cherry picked from commit 2bcdacb70327013ca2066bfcf2af1009eff01f1d
("HID: sony: Fix memory corruption issue on cleanup."))
Signed-off-by: Siarhei Vishniakou <svv@google.com>
Diffstat (limited to 'drivers/hid')
| -rw-r--r-- | drivers/hid/hid-sony.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index fa1f56b1427c..353629aab49a 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -2711,7 +2711,6 @@ err_stop: kfree(sc->output_report_dmabuf); sony_remove_dev_list(sc); sony_release_device_id(sc); - hid_hw_stop(hdev); return ret; } @@ -2770,6 +2769,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; } |
