From 895c09477932acb3888961ac7d1c122c36f067d1 Mon Sep 17 00:00:00 2001 From: Andre Eisenbach Date: Fri, 25 Mar 2016 16:48:44 -0700 Subject: [PATCH] Remove unused p_db for A2DP service discovery This fixes a crash (SIGSEGV) when re-connecting A2DP devices where the SDP pointer was incorrectly reset to 0. Bug: 27852645 Change-Id: Ie40b7e57fc117c6fe7a42020600745ef348b503c --- bta/av/bta_av_aact.c | 1 - stack/a2dp/a2d_api.c | 3 +-- stack/include/a2d_api.h | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/bta/av/bta_av_aact.c b/bta/av/bta_av_aact.c index 348e9c6f3..6c5d874f3 100644 --- a/bta/av/bta_av_aact.c +++ b/bta/av/bta_av_aact.c @@ -1017,7 +1017,6 @@ void bta_av_do_disc_a2d (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data) /* set up parameters */ db_params.db_len = BTA_AV_DISC_BUF_SIZE; db_params.num_attr = 3; - db_params.p_db = NULL; db_params.p_attrs = attr_list; p_scb->uuid_int = p_data->api_open.uuid; p_scb->sdp_discovery_started = TRUE; diff --git a/stack/a2dp/a2d_api.c b/stack/a2dp/a2d_api.c index 8260cd7b3..2f31d1ba9 100644 --- a/stack/a2dp/a2d_api.c +++ b/stack/a2dp/a2d_api.c @@ -306,8 +306,7 @@ tA2D_STATUS A2D_FindService(UINT16 service_uuid, BD_ADDR bd_addr, if (result == TRUE) { - /* store service_uuid and discovery db pointer */ - a2d_cb.find.p_db = p_db->p_db; + /* store service_uuid */ a2d_cb.find.service_uuid = service_uuid; a2d_cb.find.p_cback = p_cback; diff --git a/stack/include/a2d_api.h b/stack/include/a2d_api.h index f786670ab..75d2755e8 100644 --- a/stack/include/a2d_api.h +++ b/stack/include/a2d_api.h @@ -102,7 +102,6 @@ typedef struct { UINT32 db_len; /* Length, in bytes, of the discovery database */ UINT16 num_attr;/* The number of attributes in p_attrs */ - tSDP_DISCOVERY_DB *p_db; /* Pointer to the discovery database */ UINT16 *p_attrs; /* The attributes filter. If NULL, A2DP API sets the attribute filter * to be ATTR_ID_SERVICE_CLASS_ID_LIST, ATTR_ID_BT_PROFILE_DESC_LIST, * ATTR_ID_SUPPORTED_FEATURES, ATTR_ID_SERVICE_NAME and ATTR_ID_PROVIDER_NAME. -- 2.11.0