-
Notifications
You must be signed in to change notification settings - Fork 349
Module api conversion of NXP, RTNR, and Selector modules #10295
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
Module api conversion of NXP, RTNR, and Selector modules #10295
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR converts NXP, RTNR, and Selector audio modules to use module-based memory allocation APIs instead of direct SOF memory allocation. The conversion standardizes memory management across these modules by using the module API pattern for allocation and automatic cleanup.
- Replaces direct memory allocation/deallocation with module-managed memory APIs
- Simplifies error handling by removing manual cleanup paths in init functions
- Updates free functions to rely on automatic module cleanup instead of explicit memory deallocation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/audio/selector/selector.c | Converts to mod_zalloc and removes manual memory cleanup |
| src/audio/rtnr/rtnr.c | Updates allocation APIs and simplifies error handling paths |
| src/audio/nxp/eap.c | Migrates to module memory APIs and removes manual buffer management |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
3c392d3 to
43409ed
Compare
src/audio/nxp/eap.c
Outdated
| comp_err(dev, "nxp_eap_init() failed to get instance handle err: %d", lvm_ret); | ||
| ret = -EINVAL; | ||
| goto free_mem; | ||
| return -EINVAL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would leak memory? This is initialisation, if initialisation fails, the destructor isn't called.
src/audio/rtnr/rtnr.c
Outdated
| comp_err(dev, "comp_data_blob_handler_new() failed."); | ||
| ret = -ENOMEM; | ||
| goto cd_fail; | ||
| return -ENOMEM; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. Please check other cases as well
lyakh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed by #10320
Allocate all memory, blob handlers, and fast_get() buffers through module API mod_alloc() and friends. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through module API mod_alloc() and friends. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through module API mod_alloc() and friends. The IPC3 implementation of selector uses the component interface directly and can not use the new module API. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
43409ed to
089610a
Compare
|
These new versions of module conversions use module API to allocate the resources, but the code still has all the resource freeing code in place. |
|
@lrudyX jenkins looking OK, real issue or do we need a rerun ? |
Looks like False positive, waits for rerun. |
No description provided.