Commit eb218a54 authored by Morten Priess's avatar Morten Priess Committed by Christopher Friedt
Browse files

Bluetooth: controller: Prevent multiple ticker_stop in cis_disabled_cb



When calling ull_conn_iso_cis_stop with no pending LLL events,
cis_disabled_cb may be called recursively if more than one CIS is
associated with a disconnecting ACL connection.

To prevent ticker_stop being called more than once, it shall be
registered at entry of cis_disabled_cb whether this is the last CIS.
Only then shall ticker_stop be called.

Signed-off-by: default avatarMorten Priess <mtpr@oticon.com>
parent f3a0ae0c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -473,11 +473,11 @@ static void cis_disabled_cb(void *param)
	struct ll_conn_iso_stream *cis;
	uint32_t ticker_status;
	uint16_t handle_iter;
	uint8_t is_last_cis;
	uint8_t cis_idx;
	uint8_t num_cis;

	cig = HDR_LLL2ULL(param);
	num_cis = cig->lll.num_cis;
	is_last_cis = cig->lll.num_cis == 1;
	handle_iter = UINT16_MAX;

	/* Remove all CISes marked for teardown */
@@ -505,7 +505,7 @@ static void cis_disabled_cb(void *param)
		}
	}

	if (num_cis && cig->lll.num_cis == 0) {
	if (is_last_cis && cig->lll.num_cis == 0) {
		/* This was the last CIS of the CIG. Initiate CIG teardown by
		 * stopping ticker.
		 */