OSDN Git Service

DO NOT MERGE Fix bug where btpan_control_state_callback is called with invalid...
authorAriel Gertzenstein <agertzen@google.com>
Sun, 2 Feb 2014 00:53:15 +0000 (16:53 -0800)
committerAriel Gertzenstein <agertzen@google.com>
Wed, 16 Apr 2014 21:04:43 +0000 (17:04 -0400)
When there's a connection error, btpan_control_state_callback sometimes
gets called back with incorrect local_role and remote_role values. These
values are simply not set (uninitialized) on one of the error handling
codepaths.

http://b/12854810

Change-Id: Ie2d9d252f185fca48ee6e2bfb697039d0ac10b43

bta/pan/bta_pan_act.c

index b01e95a..d0939d6 100644 (file)
@@ -457,6 +457,8 @@ void bta_pan_open(tBTA_PAN_SCB *p_scb, tBTA_PAN_DATA *p_data)
         bta_pan_scb_dealloc(p_scb);
         bdcpy(data.bd_addr, p_data->api_open.bd_addr);
         data.status = BTA_PAN_FAIL;
+        data.local_role = p_data->api_open.local_role;
+        data.peer_role = p_data->api_open.peer_role;
         bta_pan_cb.p_cback(BTA_PAN_OPEN_EVT, (tBTA_PAN *)&data);
     }