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

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

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2011-09-21 08:47:23

Hi Frédéric,

2011/9/6 Frédéric Dalleau [off-list ref]:
quoted hunk ↗ jump to hunk
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

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

-- 
Luiz Augusto von Dentz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help