OSDN Git Service

Fix race condition during simultaneous SDP
authorJakub Pawlowski <jpawlowski@google.com>
Wed, 2 Dec 2015 17:33:20 +0000 (09:33 -0800)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 4 Dec 2015 01:34:26 +0000 (01:34 +0000)
commit1b3ac367492750439ebecd393af1799242767ef3
tree273513b4331ed9c499f07b32001d16631e7703ac
parentcc79505e542cab5d686f8dba298f6b0c224a8129
Fix race condition during simultaneous SDP

Right now sdp_conn_id and p_sdp_db are stored in static global
bta_gattc_cb between call to bta_gattc_sdp_service_disc and
bta_gattc_sdp_callback. If multiple instances of SDP discovery
are running simultaneously, they override this field, and free
same memory multiple times. This patch fixes that by making sure
sdp_conn_id and p_sdp_db are unique for each SDP discovery.

Bug: 25801255
Change-Id: I8ec52229e906e6b8748db7504f77e1f4d7006fbe
bta/gatt/bta_gattc_cache.c
bta/gatt/bta_gattc_int.h