linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: linux-bluetooth@vger.kernel.org
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: [PATCH] input/hog: Remove HID device after HoG device disconnects
Date: Fri, 14 Jun 2019 17:31:25 +0200	[thread overview]
Message-ID: <20190614153125.2605-1-hadess@hadess.net> (raw)

From: Benjamin Tissoires <benjamin.tissoires@redhat.com>

When the Bluetooth LE device disconnects, make sure to also destroy the
uHID device so that we don't have a lingering HID device accessible from
user-space.

This also fixes the input subsystem never seeing the device reattaching,
causing settings that should be applied on connection not to be applied.

https://bugzilla.kernel.org/show_bug.cgi?id=202909

Tested-by: Bastien Nocera <hadess@hadess.net>
---
 profiles/input/hog.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index 23c9c1529..83c017dcb 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -199,6 +199,8 @@ static int hog_disconnect(struct btd_service *service)
 	struct hog_device *dev = btd_service_get_user_data(service);
 
 	bt_hog_detach(dev->hog);
+	bt_hog_unref(dev->hog);
+	dev->hog = NULL;
 
 	btd_service_disconnecting_complete(service, 0);
 
-- 
2.21.0


             reply	other threads:[~2019-06-14 15:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 15:31 Bastien Nocera [this message]
2019-07-15 12:51 ` [PATCH] input/hog: Remove HID device after HoG device disconnects Szymon Janc

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=20190614153125.2605-1-hadess@hadess.net \
    --to=hadess@hadess.net \
    --cc=benjamin.tissoires@redhat.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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).