Thread (14 messages) flat view 14 messages, 3 authors, 2011-09-27
STALE5476d

[PATCH v5 5/6] Fix reference count issue in incoming connections

From: Frédéric Dalleau <hidden>
Date: 2011-09-06 13:55:52
Subsystem: the rest · Maintainer: Linus Torvalds

In case of incoming RFCOMM connection, manager
calls gateway_connect_rfcomm which already take
reference to GIOChannel, hence no need to take
another one.
---
 audio/gateway.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/audio/gateway.c b/audio/gateway.c
index 945477e..f3e6c6a 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -325,7 +325,8 @@ static void rfcomm_connect_cb(GIOChannel *chan, GError *err,
 
 	sk = g_io_channel_unix_get_fd(chan);
 
-	gw->rfcomm = g_io_channel_ref(chan);
+	if (gw->rfcomm == NULL)
+		gw->rfcomm = g_io_channel_ref(chan);
 
 	ret = agent_sendfd(gw->agent, sk, newconnection_reply, dev);
 
-- 
1.7.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help