[PATCH 07/17] SAP: Fix missing setting conn->io to NULL after unref

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

 



conn->io should be set to NULl after unref to avoid calling shutdown
and unref twice.
---
 sap/server.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/sap/server.c b/sap/server.c
index f66e23f..c385baa 100644
--- a/sap/server.c
+++ b/sap/server.c
@@ -567,6 +567,7 @@ static gboolean guard_timeout(gpointer data)
 		if (conn->io) {
 			g_io_channel_shutdown(conn->io, TRUE, NULL);
 			g_io_channel_unref(conn->io);
+			conn->io = NULL;
 		}
 		break;
 
@@ -686,6 +687,7 @@ int sap_disconnect_rsp(void *sap_device)
 		if (conn->io) {
 			g_io_channel_shutdown(conn->io, TRUE, NULL);
 			g_io_channel_unref(conn->io);
+			conn->io = NULL;
 		}
 
 		return 0;
-- 
on behalf of ST-Ericsson

--
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