Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: CSIP: Fix off-by-one in in lock restore #80937

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

Thalley
Copy link
Collaborator

@Thalley Thalley commented Nov 5, 2024

If the lock request was rejected by a set member we should restore any previously written logs in reverse order.

However there was a off-by-one error in
csip_set_coordinator_write_lock_cb which caused us to attempt to release member[1] instead of member[0] if member[1] was the one that rejected the lock request.

Additionally, the lock_set_complete would be called prematurely before we get the response from the restore request.

fixes #80936

jhedberg
jhedberg previously approved these changes Nov 5, 2024
@mmahadevan108 mmahadevan108 added the bug The issue is a bug, or the PR is fixing a bug label Nov 5, 2024
@Thalley Thalley added this to the v4.0.0 milestone Nov 6, 2024
kruithofa
kruithofa previously approved these changes Nov 6, 2024
@dkalowsk
Copy link
Contributor

dkalowsk commented Nov 7, 2024

@Thalley needs a local rebase

If the lock request was rejected by a set member we should
restore any previously written logs in reverse order.

However there was a off-by-one error in
csip_set_coordinator_write_lock_cb which caused us to attempt to
release member[1] instead of member[0] if member[1] was the
one that rejected the lock request.

Additionally, the lock_set_complete would be called
prematurely before we get the response from the restore
request.

Signed-off-by: Emil Gydesen <[email protected]>
@Thalley Thalley dismissed stale reviews from kruithofa and jhedberg via aba318a November 7, 2024 18:08
@Thalley Thalley requested review from jhedberg and kruithofa November 7, 2024 18:08
@mmahadevan108 mmahadevan108 merged commit 7c40b07 into zephyrproject-rtos:main Nov 8, 2024
26 checks passed
@Thalley Thalley deleted the csip_restore_fix branch November 8, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Audio area: Bluetooth bug The issue is a bug, or the PR is fixing a bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Bluetooth: CSIP: csip_set_coordinator_write_lock_cb has off-by-one issue
6 participants