+++ /dev/null
-From: Johan Hedberg <johan.hedberg@nokia.com>
-Date: Mon, 8 Jun 2009 04:06:33 +0000 (+0700)
-Subject: Fix bt_cancel_discovery calls in case of SDP failures
-X-Git-Url: http://git.kernel.org/?p=bluetooth%2Fbluez.git;a=commitdiff_plain;h=9d7f87e0e8693b3645da5d66dec736d1ee3e9359
-
-Fix bt_cancel_discovery calls in case of SDP failures
-
-We shouldn't call bt_cancel_discovery if we're withing a SDP callback so
-always make sure that p->svclass is 0 before calling
-pending_connect_finalize (which uses this value to determine whether
-cancelation is needed). The glib-helper.c code should still safeguard
-against this too and that's what the previous commit fixes.
----
-
-diff --git a/audio/headset.c b/audio/headset.c
-index 7e689ff..86cce52 100644
---- a/audio/headset.c
-+++ b/audio/headset.c
-@@ -1456,6 +1456,7 @@ failed_not_supported:
- if (p->msg)
- error_not_supported(dev->conn, p->msg);
- failed:
-+ p->svclass = 0;
- pending_connect_finalize(dev);
- headset_set_state(dev, HEADSET_STATE_DISCONNECTED);
- }
+++ /dev/null
-From: Johan Hedberg <johan.hedberg@nokia.com>
-Date: Mon, 8 Jun 2009 04:03:32 +0000 (+0700)
-Subject: Set ctxt->session to NULL after calling sdp_close on it
-X-Git-Url: http://git.kernel.org/?p=bluetooth%2Fbluez.git;a=commitdiff_plain;h=ce0e301583fce9e4a691fea1a12794c2fb40626c;hp=bbd50bd6e7c2c1e9b519ece0c9c4ff23cc97e363
-
-Set ctxt->session to NULL after calling sdp_close on it
-
-This makes sure that we don't do a double-close in case the user callback
-calls e.g. bt_cancel_discovery.
----
-
-diff --git a/common/glib-helper.c b/common/glib-helper.c
-index c06b32c..727c55d 100644
---- a/common/glib-helper.c
-+++ b/common/glib-helper.c
-@@ -234,6 +234,7 @@ static gboolean search_process_cb(GIOChannel *chan,
- failed:
- if (err) {
- sdp_close(ctxt->session);
-+ ctxt->session = NULL;
-
- if (ctxt->cb)
- ctxt->cb(NULL, err, ctxt->user_data);
-@@ -290,6 +291,7 @@ static gboolean connect_watch(GIOChannel *chan, GIOCondition cond, gpointer user
-
- failed:
- sdp_close(ctxt->session);
-+ ctxt->session = NULL;
-
- if (ctxt->cb)
- ctxt->cb(NULL, -err, ctxt->user_data);
-@@ -395,7 +397,8 @@ int bt_cancel_discovery(const bdaddr_t *src, const bdaddr_t *dst)
- if (ctxt->io_id)
- g_source_remove(ctxt->io_id);
-
-- sdp_close(ctxt->session);
-+ if (ctxt->session)
-+ sdp_close(ctxt->session);
-
- search_context_cleanup(ctxt);
- return 0;