linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] android/socket: Cleanup sockets on unregister
@ 2013-12-02 15:46 Andrei Emeltchenko
  2013-12-02 15:46 ` [PATCH 2/4] android/a2dp: Fix possible NULL dereference Andrei Emeltchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrei Emeltchenko @ 2013-12-02 15:46 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

This cleans up rfsock structures closing all sockets and making general cleanup
for servers and for connections. This will be called form socket unregister.
---
 android/socket.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/android/socket.c b/android/socket.c
index 76b40c8..4502e90 100644
--- a/android/socket.c
+++ b/android/socket.c
@@ -93,8 +93,10 @@ static struct rfcomm_sock *create_rfsock(int sock, int *hal_fd)
 	return rfsock;
 }
 
-static void cleanup_rfsock(struct rfcomm_sock *rfsock)
+static void cleanup_rfsock(gpointer data)
 {
+	struct rfcomm_sock *rfsock = data;
+
 	DBG("rfsock: %p fd %d real_sock %d chan %u",
 		rfsock, rfsock->fd, rfsock->real_sock, rfsock->channel);
 
@@ -936,5 +938,8 @@ void bt_socket_unregister(void)
 {
 	DBG("");
 
+	g_list_free_full(connections, cleanup_rfsock);
+	g_list_free_full(servers, cleanup_rfsock);
+
 	ipc_unregister(HAL_SERVICE_ID_SOCK);
 }
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-02 15:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-02 15:46 [PATCH 1/4] android/socket: Cleanup sockets on unregister Andrei Emeltchenko
2013-12-02 15:46 ` [PATCH 2/4] android/a2dp: Fix possible NULL dereference Andrei Emeltchenko
2013-12-02 15:46 ` [PATCH 3/4] android/pan: Remove unneeded NULL assignment Andrei Emeltchenko
2013-12-02 15:46 ` [PATCH 4/4] android/pan: Fix no return on error path Andrei Emeltchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).