Skip to contentSkip to conversation

input: Fix not removing security watch when disconnecting

PATCH New Luiz Augusto von Dentz 1 participant 1 message Jul 24, 2019 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 input: Fix not removing security watch when disconnecting

From: Luiz Augusto von Dentz <[email protected]>

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(+)
profiles/input/device.c +5 -0
index a711ef527..32c682b79 100644
@@ -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);
Signature · 1 line
2.21.0