linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mikel Astiz <mikel.astiz.oss@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Mikel Astiz <mikel.astiz@bmw-carit.de>
Subject: [PATCH obexd] client: fix possible glib assertion failure
Date: Thu, 26 Jan 2012 16:33:44 +0100	[thread overview]
Message-ID: <1327592024-1644-1-git-send-email-mikel.astiz.oss@gmail.com> (raw)

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


             reply	other threads:[~2012-01-26 15:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-26 15:33 Mikel Astiz [this message]
2012-01-27 10:50 ` [PATCH obexd] client: fix possible glib assertion failure Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327592024-1644-1-git-send-email-mikel.astiz.oss@gmail.com \
    --to=mikel.astiz.oss@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=mikel.astiz@bmw-carit.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).