Skip to content

Commit e70c928

Browse files
committed
bluetooth: services: ras: rrsp: Fix bug with multiple subevents
Ranging responder had a bug where it could not handle multiple subevents in a CS procedure. Update this to only free the buffer when dropping the procedure. Signed-off-by: Sean Madigan <[email protected]>
1 parent d1f62cd commit e70c928

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

subsys/bluetooth/services/ras/rrsp/ras_rd_buffer.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,15 @@ static void subevent_data_available(struct bt_conn *conn,
265265
/* process_step_data might have requested dropping this procedure. */
266266
bool drop = (drop_procedure_counter[conn_index] == result->header.procedure_counter);
267267

268-
if (hdr->ranging_done_status == BT_CONN_LE_CS_PROCEDURE_COMPLETE && !drop) {
268+
if (drop) {
269+
rd_buffer_free(buf);
270+
return;
271+
}
272+
273+
if (hdr->ranging_done_status == BT_CONN_LE_CS_PROCEDURE_COMPLETE) {
269274
buf->ready = true;
270275
buf->busy = false;
271276
notify_new_rd_stored(conn, result->header.procedure_counter);
272-
} else {
273-
rd_buffer_free(buf);
274277
}
275278
}
276279

0 commit comments

Comments
 (0)