bluetooth: Fix crash on disconnection
authorFrédéric Danis <frederic.danis@linux.intel.com>
Tue, 15 May 2012 13:55:36 +0000 (15:55 +0200)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Tue, 3 Jul 2012 11:48:13 +0000 (17:18 +0530)
commit1c055d70b09fd63156cdc8a49989977031e0f4af
tree8a9ab4c87965507cc8cf2b9746fe5dbbfe794faf
parent3643966f676c5084574811ee5c61e6c3b1383575
bluetooth: Fix crash on disconnection

When a Bluetooth headset is connected only to HFP profile (not connected
to A2DP) and host streams to it, a crash occurs if host disconnects.

When HFP disconnects, audio thread will fail on POLLHUP then generate
a message to set PA profile to Off before ending.
If this message is managed before PA unload bluetooth device module,
all works fine.
But, if this message is managed during module unload, this finish by
re-entrance in release code (stop_thread) and a crash.

This fix prevents to process profile change when module is unloading.
src/modules/bluetooth/module-bluetooth-device.c