All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HID: sony: Fix memory corruption issue on cleanup.
@ 2019-09-04 21:22 Roderick Colenbrander
  2019-09-05 12:27 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Roderick Colenbrander @ 2019-09-04 21:22 UTC (permalink / raw)
  To: linux-input, jikos, andreyknvl; +Cc: Roderick Colenbrander, stable

From: Roderick Colenbrander <roderick.colenbrander@sony.com>

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
---
 drivers/hid/hid-sony.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 31f1023214d3..09f2c617b09f 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2806,7 +2806,6 @@ static int sony_input_configured(struct hid_device *hdev,
 	sony_cancel_work_sync(sc);
 	sony_remove_dev_list(sc);
 	sony_release_device_id(sc);
-	hid_hw_stop(hdev);
 	return ret;
 }
 
@@ -2868,6 +2867,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;
 	}
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: sony: Fix memory corruption issue on cleanup.
  2019-09-04 21:22 [PATCH] HID: sony: Fix memory corruption issue on cleanup Roderick Colenbrander
@ 2019-09-05 12:27 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2019-09-05 12:27 UTC (permalink / raw)
  To: Roderick Colenbrander
  Cc: linux-input, andreyknvl, Roderick Colenbrander, stable

On Wed, 4 Sep 2019, Roderick Colenbrander wrote:

> From: Roderick Colenbrander <roderick.colenbrander@sony.com>
> 
> 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

Applied, thanks Roderick.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-05 12:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 21:22 [PATCH] HID: sony: Fix memory corruption issue on cleanup Roderick Colenbrander
2019-09-05 12:27 ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.