From de9fd59669d7eead5f0713a9bbaa5e291837a90c Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Wed, 29 Apr 2020 15:14:14 +0200 Subject: [PATCH] drivers/bluetooth: stm32wb: Fix loop The goto instruction was removed when adding the RX thread. While still working, this clearly break the clean handling of error cases. Re-instantiate the goto instruction. Signed-off-by: Erwan Gouriou --- drivers/bluetooth/hci/ipm_stm32wb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/bluetooth/hci/ipm_stm32wb.c b/drivers/bluetooth/hci/ipm_stm32wb.c index 359467979d9..6ae94823ee2 100644 --- a/drivers/bluetooth/hci/ipm_stm32wb.c +++ b/drivers/bluetooth/hci/ipm_stm32wb.c @@ -168,8 +168,8 @@ static void bt_ipm_rx_thread(void) /* Vendor events are currently unsupported */ BT_ERR("Unknown evtcode type 0x%02x", hcievt->evtserial.evt.evtcode); - k_sem_give(&ipm_busy); - break; + TL_MM_EvtDone(hcievt); + goto end_loop; default: buf = bt_buf_get_evt( hcievt->evtserial.evt.evtcode, @@ -194,7 +194,7 @@ static void bt_ipm_rx_thread(void) BT_ERR("Unknown BT buf type %d", hcievt->evtserial.type); TL_MM_EvtDone(hcievt); - k_sem_give(&ipm_busy); + goto end_loop; } TL_MM_EvtDone(hcievt); @@ -206,6 +206,7 @@ static void bt_ipm_rx_thread(void) bt_recv(buf); } +end_loop: k_sem_give(&ipm_busy); }