diff options
author | Ganesh Ganapathi Batta <ganeshg@broadcom.com> | 2012-05-29 10:42:21 -0700 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-07-14 11:19:21 -0700 |
commit | fe1b7a6c392ef7ccc371e3bf580f2e853d0d6c65 (patch) | |
tree | c655cc9f0d93000930f76d6be64e29dcfcb5a080 /btif | |
parent | 001b6bbb50d8d371015efc12401ae1a2014b5f20 (diff) | |
download | external_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')
-rwxr-xr-x[-rw-r--r--] | btif/include/btif_profile_queue.h | 2 | ||||
-rwxr-xr-x | btif/src/btif_core.c | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | btif/src/btif_profile_queue.c | 24 |
3 files changed, 28 insertions, 0 deletions
diff --git a/btif/include/btif_profile_queue.h b/btif/include/btif_profile_queue.h index c9ed0e7..8f5f013 100644..100755 --- a/btif/include/btif_profile_queue.h +++ b/btif/include/btif_profile_queue.h @@ -62,4 +62,6 @@ bt_status_t btif_queue_connect(uint16_t uuid, const bt_bdaddr_t *bda, void btif_queue_advance(); +void btif_queue_release(); + #endif 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; +} + |