Skip to content

Conversation

mkasenberg
Copy link
Contributor

@mkasenberg mkasenberg commented May 20, 2025

Fixes a segmentation fault that occurred when canceling ext discovery.

@github-actions github-actions bot added controller size/XS Extra small PR labels May 20, 2025
@@ -920,6 +920,10 @@ ble_ll_sched_rmv_elem_type(uint8_t type, sched_remove_cb_func remove_cb)
OS_ENTER_CRITICAL(sr);

first = TAILQ_FIRST(&g_ble_ll_sched_q);
if (!first) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OS_EXIT_CRITICAL is missing here

Fix potential NULL dereference that occurs when cancelling extended
discovery.
@mkasenberg
Copy link
Contributor Author

Force pushed to fix missing commit message

Copy link
Contributor

@MariuszSkamra MariuszSkamra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we found the same issue #2083 :)

Comment on lines 928 to 930
if (first->sched_type == type) {
first_removed = 1;
}
Copy link
Contributor

@MariuszSkamra MariuszSkamra Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that this needs to be fixed as well as first_removed can be left uninitialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
controller size/XS Extra small PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants