linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] profile: Fix printing error when disconnecting
@ 2017-09-25 12:43 Luiz Augusto von Dentz
  0 siblings, 0 replies; only message in thread
From: Luiz Augusto von Dentz @ 2017-09-25 12:43 UTC (permalink / raw)
  To: linux-bluetooth

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

Some profiles may shutdown the socket when disconnecting which can
cause the following error:

bluetoothd[816]: Unable to get io data for hfp_hf: getpeername: Transport endpoint is not connected (107)
---
 src/profile.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/profile.c b/src/profile.c
index 7c5318caf..b23e89088 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -787,22 +787,15 @@ static gboolean ext_io_disconnected(GIOChannel *io, GIOCondition cond,
 {
 	struct ext_io *conn = user_data;
 	struct ext_profile *ext = conn->ext;
-	GError *gerr = NULL;
 	char addr[18];
 
 	if (cond & G_IO_NVAL)
 		return FALSE;
 
-	bt_io_get(io, &gerr, BT_IO_OPT_DEST, addr, BT_IO_OPT_INVALID);
-	if (gerr != NULL) {
-		error("Unable to get io data for %s: %s",
-						ext->name, gerr->message);
-		g_error_free(gerr);
-		goto drop;
-	}
+	ba2str(device_get_address(conn->device), addr);
 
 	DBG("%s disconnected from %s", ext->name, addr);
-drop:
+
 	if (conn->service) {
 		if (btd_service_get_state(conn->service) ==
 						BTD_SERVICE_STATE_CONNECTING)
-- 
2.13.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-25 12:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-25 12:43 [PATCH BlueZ] profile: Fix printing error when disconnecting Luiz Augusto von Dentz

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