release command semaphore after timeout

This commit is contained in:
Gilles Boccon-Gibod
2026-04-15 16:54:54 +02:00
parent f2824ee6b8
commit f7cc6f6657
2 changed files with 23 additions and 7 deletions

View File

@@ -692,10 +692,8 @@ class Host(utils.EventEmitter):
finally:
self.pending_command = None
self.pending_response = None
if (
response is not None
and response.num_hci_command_packets
and self.command_semaphore.locked()
if response is None or (
response.num_hci_command_packets and self.command_semaphore.locked()
):
self.command_semaphore.release()