Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH BlueZ] input: Fix not removing security watch when disconnecting
@ 2019-07-24 11:01 Luiz Augusto von Dentz
  0 siblings, 0 replies; only message in thread
From: Luiz Augusto von Dentz @ 2019-07-24 11:01 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If interrupt channels disconnects the security watch would be left
dangling as the channel is being shutdown which can cause some bugs:

https://bugzilla.kernel.org/show_bug.cgi?id=204275
---
 profiles/input/device.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/profiles/input/device.c b/profiles/input/device.c
index a711ef527..32c682b79 100644
--- a/profiles/input/device.c
+++ b/profiles/input/device.c
@@ -327,6 +327,11 @@ static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond, gpointer data
 		idev->intr_io = NULL;
 	}
 
+	if (idev->sec_watch > 0) {
+		g_source_remove(idev->sec_watch);
+		idev->sec_watch = 0;
+	}
+
 	/* Close control channel */
 	if (idev->ctrl_io && !(cond & G_IO_NVAL))
 		g_io_channel_shutdown(idev->ctrl_io, TRUE, NULL);
-- 
2.21.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 11:01 [PATCH BlueZ] input: Fix not removing security watch when disconnecting Luiz Augusto von Dentz

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org linux-bluetooth@archiver.kernel.org
	public-inbox-index linux-bluetooth


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/ public-inbox