From: Roderick Colenbrander <roderick@gaikai.com>
To: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Simon Wood <simon@mungewell.org>,
Frank Praznik <frank.praznik@gmail.com>,
Tim Bird <tim.bird@am.sony.com>,
Roderick Colenbrander <roderick.colenbrander@sony.com>
Subject: [PATCH] HID: sony: Fix input device leak when connecting a DS4 twice using USB/BT
Date: Thu, 23 Feb 2017 15:56:13 -0800 [thread overview]
Message-ID: <20170223235613.5112-2-roderick@gaikai.com> (raw)
In-Reply-To: <20170223235613.5112-1-roderick@gaikai.com>
From: Roderick Colenbrander <roderick.colenbrander@sony.com>
When a user connects a DS4 twice using USB and BT, we reject the
second device connection after the setup work. We then perform
a cleanup, but during cleanup we are not removing the touchpad
device. This leads to leakage of an input device, which we would
never remove. It can likely result into a kernel oops as well
when the touchpad evdev node is accessed and the underlaying HID
device has been removed from the system.
---
drivers/hid/hid-sony.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index f405b07..740996f 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2632,6 +2632,8 @@ static int sony_input_configured(struct hid_device *hdev,
sony_leds_remove(sc);
if (sc->quirks & SONY_BATTERY_SUPPORT)
sony_battery_remove(sc);
+ if (sc->touchpad)
+ sony_unregister_touchpad(sc);
sony_cancel_work_sync(sc);
kfree(sc->output_report_dmabuf);
sony_remove_dev_list(sc);
--
2.9.3
next prev parent reply other threads:[~2017-02-23 23:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-23 23:56 [PATCH] HID: sony: 4.10 fixes Roderick Colenbrander
2017-02-23 23:56 ` Roderick Colenbrander [this message]
2017-02-24 7:02 ` [PATCH] HID: sony: Fix input device leak when connecting a DS4 twice using USB/BT Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170223235613.5112-2-roderick@gaikai.com \
--to=roderick@gaikai.com \
--cc=benjamin.tissoires@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=frank.praznik@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=roderick.colenbrander@sony.com \
--cc=simon@mungewell.org \
--cc=tim.bird@am.sony.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).