From fe1b7a6c392ef7ccc371e3bf580f2e853d0d6c65 Mon Sep 17 00:00:00 2001 From: Ganesh Ganapathi Batta Date: Tue, 29 May 2012 10:42:21 -0700 Subject: Fix for BLTH01456966 : Clear stack's connection queue when the BT is disabled Change-Id: I075e5f95d354d81925b9dbfd06ae89efa8bf6eb3 --- btif/src/btif_core.c | 2 ++ btif/src/btif_profile_queue.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) mode change 100644 => 100755 btif/src/btif_profile_queue.c (limited to 'btif/src') 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 old mode 100644 new mode 100755 index f0b6db2..4081c6a --- 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; +} + -- cgit v1.1