OSDN Git Service

Avoid NULL pointer usage of startup_future in case of HCI startup timeout
authorPavlin Radoslavov <pavlin@google.com>
Wed, 4 May 2016 03:20:06 +0000 (20:20 -0700)
committerPavlin Radoslavov <pavlin@google.com>
Wed, 4 May 2016 03:20:06 +0000 (20:20 -0700)
commit3d1aa9d3856342764db13503a07452a79edbaeda
tree1daac3046293d5c0f1bc9663c061a25fb0d1b5f6
parent757b1b48d72a917443a6eb48dba45075d0e546c9
Avoid NULL pointer usage of startup_future in case of HCI startup timeout

Previously, the startup_timer was created within the HCI layer start_up()
function, and after several vendor calls, we created the startup_future
that is used elsewhere. However, if any of the vendor calls blocks for
very long time, the startup_timer will timeout.
The startup_timer_expired() callback will try to use startup_future
that is still NULL, and that will trigger an assert.

The issue is avoided by creating the startup_future right before
the startup_timer is scheduled.

Bug: 28528815
Change-Id: Ib9f2c6581a86d3df0fd4d02d0b4c290663b5cfa1
hci/src/hci_layer.c