[PATCH v3 1/3] android/sco: Fix for disconnect SCO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We should just shutdown io and wait for disconnect callback in
disconnect function, otherwise we might get some races e.g. when doing
connect/disconnect SCO. This patch fix that.
---
 android/sco.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/android/sco.c b/android/sco.c
index 7dd7013..e8ac685 100644
--- a/android/sco.c
+++ b/android/sco.c
@@ -310,18 +310,8 @@ void bt_sco_disconnect(struct bt_sco *sco)
 	if (!sco)
 		return;
 
-	if (sco->watch) {
-		g_source_remove(sco->watch);
-		sco->watch = 0;
-	}
-
-	if (sco->io) {
+	if (sco->io)
 		g_io_channel_shutdown(sco->io, TRUE, NULL);
-		g_io_channel_unref(sco->io);
-		sco->io = NULL;
-	}
-
-	clear_remote_address(sco);
 }
 
 bool bt_sco_get_fd_and_mtu(struct bt_sco *sco, int *fd, uint16_t *mtu)
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux