]> git.pld-linux.org Git - packages/bluez.git/blob - bluez-null-session.patch
- add patches to prevent bluetoothd from crashing
[packages/bluez.git] / bluez-null-session.patch
1 From: Johan Hedberg <johan.hedberg@nokia.com>
2 Date: Mon, 8 Jun 2009 04:03:32 +0000 (+0700)
3 Subject: Set ctxt->session to NULL after calling sdp_close on it
4 X-Git-Url: http://git.kernel.org/?p=bluetooth%2Fbluez.git;a=commitdiff_plain;h=ce0e301583fce9e4a691fea1a12794c2fb40626c;hp=bbd50bd6e7c2c1e9b519ece0c9c4ff23cc97e363
5
6 Set ctxt->session to NULL after calling sdp_close on it
7
8 This makes sure that we don't do a double-close in case the user callback
9 calls e.g. bt_cancel_discovery.
10 ---
11
12 diff --git a/common/glib-helper.c b/common/glib-helper.c
13 index c06b32c..727c55d 100644
14 --- a/common/glib-helper.c
15 +++ b/common/glib-helper.c
16 @@ -234,6 +234,7 @@ static gboolean search_process_cb(GIOChannel *chan,
17  failed:
18         if (err) {
19                 sdp_close(ctxt->session);
20 +               ctxt->session = NULL;
21  
22                 if (ctxt->cb)
23                         ctxt->cb(NULL, err, ctxt->user_data);
24 @@ -290,6 +291,7 @@ static gboolean connect_watch(GIOChannel *chan, GIOCondition cond, gpointer user
25  
26  failed:
27         sdp_close(ctxt->session);
28 +       ctxt->session = NULL;
29  
30         if (ctxt->cb)
31                 ctxt->cb(NULL, -err, ctxt->user_data);
32 @@ -395,7 +397,8 @@ int bt_cancel_discovery(const bdaddr_t *src, const bdaddr_t *dst)
33         if (ctxt->io_id)
34                 g_source_remove(ctxt->io_id);
35  
36 -       sdp_close(ctxt->session);
37 +       if (ctxt->session)
38 +               sdp_close(ctxt->session);
39  
40         search_context_cleanup(ctxt);
41         return 0;
This page took 0.139643 seconds and 3 git commands to generate.