summaryrefslogtreecommitdiffstats
path: root/btif/src
diff options
context:
space:
mode:
authorGanesh Ganapathi Batta <ganeshg@broadcom.com>2012-05-29 10:42:21 -0700
committerMatthew Xie <mattx@google.com>2012-07-14 11:19:21 -0700
commitfe1b7a6c392ef7ccc371e3bf580f2e853d0d6c65 (patch)
treec655cc9f0d93000930f76d6be64e29dcfcb5a080 /btif/src
parent001b6bbb50d8d371015efc12401ae1a2014b5f20 (diff)
downloadexternal_bluetooth_bluedroid-fe1b7a6c392ef7ccc371e3bf580f2e853d0d6c65.zip
external_bluetooth_bluedroid-fe1b7a6c392ef7ccc371e3bf580f2e853d0d6c65.tar.gz
external_bluetooth_bluedroid-fe1b7a6c392ef7ccc371e3bf580f2e853d0d6c65.tar.bz2
Fix for BLTH01456966 : Clear stack's connection queue when the BT is disabled
Change-Id: I075e5f95d354d81925b9dbfd06ae89efa8bf6eb3
Diffstat (limited to 'btif/src')
-rwxr-xr-xbtif/src/btif_core.c2
-rwxr-xr-x[-rw-r--r--]btif/src/btif_profile_queue.c24
2 files changed, 26 insertions, 0 deletions
diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c
index c8b0c8f..777c4ca 100755
--- a/btif/src/btif_core.c
+++ b/btif/src/btif_core.c
@@ -76,6 +76,7 @@
#include "btif_util.h"
#include "btif_sock.h"
#include "btif_pan.h"
+#include "btif_profile_queue.h"
/************************************************************************************
** Constants & Macros
@@ -668,6 +669,7 @@ bt_status_t btif_shutdown_bluetooth(void)
btif_shutdown_pending = 0;
GKI_destroy_task(BTIF_TASK);
+ btif_queue_release();
bte_main_shutdown();
BTIF_TRACE_DEBUG1("%s done", __FUNCTION__);
diff --git a/btif/src/btif_profile_queue.c b/btif/src/btif_profile_queue.c
index f0b6db2..4081c6a 100644..100755
--- a/btif/src/btif_profile_queue.c
+++ b/btif/src/btif_profile_queue.c
@@ -190,3 +190,27 @@ void btif_queue_advance()
NULL, 0, NULL);
}
+
+/*******************************************************************************
+**
+** Function btif_queue_release
+**
+** Description Free up all the queue nodes and set the queue head to NULL
+**
+** Returns void
+**
+*******************************************************************************/
+void btif_queue_release()
+{
+ connect_node_t *current = connect_queue;
+
+ while (current != NULL)
+ {
+ connect_node_t *next = current->p_next;
+ GKI_freebuf(current);
+ current = next;
+ }
+
+ connect_queue = NULL;
+}
+