All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] avctp: Fix not handling when kernel has ERTM disabled
@ 2021-09-24 21:18 Luiz Augusto von Dentz
  2021-09-24 21:18 ` [PATCH BlueZ 2/2] avrcp: Fix browsing support in SDP record Luiz Augusto von Dentz
  2021-09-24 21:35 ` [BlueZ,1/2] avctp: Fix not handling when kernel has ERTM disabled bluez.test.bot
  0 siblings, 2 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2021-09-24 21:18 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If kernel module is loaded with disable_ertm ERTM won't be available
thus browsing channel won't be able to be created, but it shall be
possible to still use AVRCP without it.

Fixes: https://github.com/bluez/bluez/issues/209
---
 profiles/audio/avctp.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
index 702ded136..81320de1b 100644
--- a/profiles/audio/avctp.c
+++ b/profiles/audio/avctp.c
@@ -1651,15 +1651,6 @@ int avctp_register(struct btd_adapter *adapter, gboolean central)
 	}
 	server->browsing_io = avctp_server_socket(src, central, BT_IO_MODE_ERTM,
 							AVCTP_BROWSING_PSM);
-	if (!server->browsing_io) {
-		if (server->control_io) {
-			g_io_channel_shutdown(server->control_io, TRUE, NULL);
-			g_io_channel_unref(server->control_io);
-			server->control_io = NULL;
-		}
-		g_free(server);
-		return -1;
-	}
 
 	server->adapter = btd_adapter_ref(adapter);
 
@@ -1681,9 +1672,11 @@ void avctp_unregister(struct btd_adapter *adapter)
 
 	servers = g_slist_remove(servers, server);
 
-	g_io_channel_shutdown(server->browsing_io, TRUE, NULL);
-	g_io_channel_unref(server->browsing_io);
-	server->browsing_io = NULL;
+	if (server->browsing_io) {
+		g_io_channel_shutdown(server->browsing_io, TRUE, NULL);
+		g_io_channel_unref(server->browsing_io);
+		server->browsing_io = NULL;
+	}
 
 	g_io_channel_shutdown(server->control_io, TRUE, NULL);
 	g_io_channel_unref(server->control_io);
-- 
2.31.1


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

end of thread, other threads:[~2021-09-27 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-24 21:18 [PATCH BlueZ 1/2] avctp: Fix not handling when kernel has ERTM disabled Luiz Augusto von Dentz
2021-09-24 21:18 ` [PATCH BlueZ 2/2] avrcp: Fix browsing support in SDP record Luiz Augusto von Dentz
2021-09-24 21:35 ` [BlueZ,1/2] avctp: Fix not handling when kernel has ERTM disabled bluez.test.bot
2021-09-27 17:44   ` Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.