linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH obexd] client: fix possible glib assertion failure
@ 2012-01-26 15:33 Mikel Astiz
  2012-01-27 10:50 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Mikel Astiz @ 2012-01-26 15:33 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Mikel Astiz

From: Mikel Astiz <mikel.astiz@bmw-carit.de>

In case of error there might be no io channel to shutdown.
---
 client/bluetooth.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/client/bluetooth.c b/client/bluetooth.c
index 3441d4b..558c408 100644
--- a/client/bluetooth.c
+++ b/client/bluetooth.c
@@ -269,9 +269,11 @@ static void search_callback(uint8_t type, uint16_t status,
 	}
 
 failed:
-	g_io_channel_shutdown(session->io, TRUE, NULL);
-	g_io_channel_unref(session->io);
-	session->io = NULL;
+	if (session->io != NULL) {
+		g_io_channel_shutdown(session->io, TRUE, NULL);
+		g_io_channel_unref(session->io);
+		session->io = NULL;
+	}
 
 	g_set_error(&gerr, OBC_BT_ERROR, -EIO,
 					"Unable to find service record");
-- 
1.7.6.5


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

end of thread, other threads:[~2012-01-27 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-26 15:33 [PATCH obexd] client: fix possible glib assertion failure Mikel Astiz
2012-01-27 10:50 ` Johan Hedberg

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