Skip to content

Bluetooth: Controller: Uninitialized parameters in functions #89306

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

Open
moudi599 opened this issue Apr 30, 2025 · 5 comments
Open

Bluetooth: Controller: Uninitialized parameters in functions #89306

moudi599 opened this issue Apr 30, 2025 · 5 comments

Comments

@moudi599
Copy link

moudi599 commented Apr 30, 2025

Hello, in file ull_adv_sync.c mainly in the following function(https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c#L2675), as u can see for example lazy parameter is only defined and not initialized, which will take any garbage value, but it must start from zero because it affects on the event_counter, so is this a bug or what?

static void mfy_sync_offset_get(void *param)
{
struct ll_adv_set *adv = param;
struct lll_adv_sync *lll_sync;
struct ll_adv_sync_set *sync;
struct pdu_adv_sync_info *si;
uint32_t sync_remainder_us;
uint32_t aux_remainder_us;
uint32_t ticks_to_expire;
uint32_t ticks_current;
struct pdu_adv *pdu;
uint32_t remainder;
uint8_t chm_first;
uint8_t ticker_id;
uint16_t lazy;
uint8_t retry;
uint8_t id;
...
}

Thank you!

@jhedberg jhedberg assigned cvinayak and unassigned jhedberg and alwa-nordic May 1, 2025
@cvinayak cvinayak changed the title Uninitialized parameters in functions Bluetooth: Controller: Uninitialized parameters in functions May 2, 2025
@cvinayak
Copy link
Collaborator

cvinayak commented May 2, 2025

lazy is assigned a value as being passed by reference to the function ticker_next_slot_get_ext(). Ensure that CONFIG_BT_TICKER_LAZY_GET=y in your implementation/sample/application.

@moudi599
Copy link
Author

moudi599 commented May 2, 2025

@cvinayak , so you mean that enabling this config is mandatory but what if it is disabled. Do we really need to enable it? Also when enabling it, it assigns a certain pointer to lazy pointer, meaning that the address of lazy will not be changed.

@cvinayak
Copy link
Collaborator

cvinayak commented May 2, 2025

It is mandatory select already in Kconfig file. If you still see errors/warning, please provide details to reproduce the issue you face. (Please use the github issue template when reporting issues, https://github.com/zephyrproject-rtos/zephyr/issues/new?template=001_bug_report.md).

@cvinayak cvinayak added the priority: low Low impact/importance bug label May 2, 2025
@moudi599
Copy link
Author

moudi599 commented May 2, 2025

Thank you, the issue is resolved, but if this config is mandatory why it is not by default enabled?

@cvinayak
Copy link
Collaborator

cvinayak commented May 2, 2025

It is already mandatory as select -ed here:

select BT_TICKER_LAZY_GET if BT_CTLR_ADV_PERIODIC || BT_CTLR_CONN_ISO || BT_CTLR_SYNC_TRANSFER_SENDER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants