Bluetooth: Fix giving back pkts semaphore when disconnecting
The TX fiber might be blocked waiting for the num_pkts semaphore when
a disconnection occurs. If we only give back the semaphore once
exiting the while-loop we may end up in a deadlock. Giving back the
semaphore in the connection disconnect handler solves this.
An additional fix this patch does is to ensure that we don't perform
integer underflow because of the last iteration.
Change-Id: Ia67dc506885d0c2bad25c598ea349f1fd251218b
Signed-off-by:
Johan Hedberg <johan.hedberg@intel.com>
Loading
Please sign in to comment