Skip to content

Commit b5ab2f1

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: Controller: Fix missing ISO data packet receive
Fix missing ISO Data packet received by Synchronized Receiver due to incorrect check on sink handle that did not permit handle value of 0. Fixed function to get ISO stream context to check for valid ISO sync context, i.e. not being terminated. Regression introduced in commit 7c89f1f ("Bluetooth: controller: Support for separate ISO RX data path"). Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 8a4c586 commit b5ab2f1

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

subsys/bluetooth/controller/hci/hci_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ static inline struct net_buf *encode_node(struct node_rx_pdu *node_rx,
387387
stream = ull_sync_iso_stream_get(node_rx->hdr.handle);
388388

389389
/* Check validity of the data path sink. FIXME: A channel disconnect race
390-
* may cause ISO data pending with without valid data path.
390+
* may cause ISO data pending without valid data path.
391391
*/
392-
if (stream && stream->dp && stream->dp->sink_hdl) {
392+
if (stream && stream->dp) {
393393
isoal_rx.meta = &node_rx->hdr.rx_iso_meta;
394394
isoal_rx.pdu = (void *)node_rx->pdu;
395395
err = isoal_rx_pdu_recombine(stream->dp->sink_hdl, &isoal_rx);

subsys/bluetooth/controller/ll_sw/ull_iso.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ uint8_t ll_setup_iso_path(uint16_t handle, uint8_t path_dir, uint8_t path_id,
238238
stream_handle = handle - BT_CTLR_SYNC_ISO_STREAM_HANDLE_BASE;
239239

240240
stream = ull_sync_iso_stream_get(stream_handle);
241-
if (stream->dp) {
241+
if (!stream || stream->dp) {
242242
return BT_HCI_ERR_CMD_DISALLOWED;
243243
}
244244
#endif /* CONFIG_BT_CTLR_CONN_ISO */
@@ -406,6 +406,10 @@ uint8_t ll_remove_iso_path(uint16_t handle, uint8_t path_dir)
406406
stream_handle = handle - BT_CTLR_SYNC_ISO_STREAM_HANDLE_BASE;
407407

408408
stream = ull_sync_iso_stream_get(stream_handle);
409+
if (!stream) {
410+
return BT_HCI_ERR_CMD_DISALLOWED;
411+
}
412+
409413
dp = stream->dp;
410414
if (dp) {
411415
stream->dp = NULL;

subsys/bluetooth/controller/ll_sw/ull_sync_iso.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ struct ll_sync_iso_set *ull_sync_iso_by_stream_get(uint16_t handle)
268268

269269
struct lll_sync_iso_stream *ull_sync_iso_stream_get(uint16_t handle)
270270
{
271-
if (handle >= CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT) {
271+
struct ll_sync_iso_set *sync_iso;
272+
273+
/* Get the BIG Sync context and check for not being terminated */
274+
sync_iso = ull_sync_iso_by_stream_get(handle);
275+
if (!sync_iso || !sync_iso->sync) {
272276
return NULL;
273277
}
274278

@@ -287,6 +291,7 @@ void ull_sync_iso_stream_release(struct ll_sync_iso_set *sync_iso)
287291

288292
handle = lll->stream_handle[lll->stream_count];
289293
stream = ull_sync_iso_stream_get(handle);
294+
LL_ASSERT(stream);
290295

291296
dp = stream->dp;
292297
if (dp) {

0 commit comments

Comments
 (0)