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

ble_conn: fix auth_pyld_timer memleak #1278

Merged
merged 1 commit into from Jun 27, 2022
Merged

Conversation

bvdberg
Copy link
Contributor

@bvdberg bvdberg commented Jun 20, 2022

Every time a connection is made, the ble_npl_callout_init() is done.
This causes a timer creation in some NPL cases (eg. FreeRTOS).
The alloc behaviour of auth_pyld_timer is now in sync with ctrl_proc_rsp_timer
that lives in the same struct.

@sjanc
Copy link
Contributor

sjanc commented Jun 24, 2022

I'm fine with having this hotfixed as is (although the leak will stil be present on each HCI reset call, right?)

in long term I think we need to expand npl api so that every init function has cleanup/deinit couterpart (or assume that some accounting will be handled by NPL layer eg freertos NPL could have internal list of timers and know if one was already created or not..)

@bvdberg
Copy link
Contributor Author

bvdberg commented Jun 24, 2022

I'm not sure about that. I see that at start, all connections you define (Max-Connections) get created and the timer also.
They are never freed, since the Max number of connections are compile-time defined. When a connection is reset (eg failed to connect) the state is reset, but the timer is not alloc'ed/freed, so that is fine.

Every time a connection is made, the  ble_npl_callout_init() is done.
This causes a timer creation in some NPL cases (eg. FreeRTOS).
The alloc behaviour of auth_pyld_timer is now in sync with ctrl_proc_rsp_timer
that lives in the same struct.
@apache-mynewt-bot
Copy link

Style check summary

No suggestions at this time!

@bvdberg
Copy link
Contributor Author

bvdberg commented Jun 27, 2022

rebased on update master

@sjanc sjanc merged commit 55f1818 into apache:master Jun 27, 2022
@bvdberg bvdberg deleted the pyld_issue branch June 27, 2022 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants