Uh oh!
There was an error while loading. Please reload this page.
Module api conversion of NXP, RTNR, and Selector modules - #10295
Conversation
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
3c392d3 to
43409edCompare| 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.
I think this would leak memory? This is initialisation, if initialisation fails, the destructor isn't called.
| comp_err(dev, "comp_data_blob_handler_new() failed."); | ||
| ret = -ENOMEM; | ||
| goto cd_fail; | ||
| return -ENOMEM; |
There was a problem hiding this comment.
same here. Please check other cases as well
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
089610aComparejsarha
commented
Oct 31, 2025
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. |
lgirdwood
commented
Nov 3, 2025
@lrudyX jenkins looking OK, real issue or do we need a rerun ? |
lrudyX
commented
Nov 3, 2025
Looks like False positive, waits for rerun. |
Uh oh!
There was an error while loading. Please reload this page.
No description provided.