Skip to content

Conversation

@softwarecki
Copy link
Collaborator

Simplyfy module instance allocate functions by extend the lib_manager_get_instance_bss_address function to also return the size of the bss section. This simplify the lib_manager_allocate_module_instance and lib_manager_free_module_instance functions.

Remove redundant value assignment to ops.prepare in the lib_manager_register_module function. This value is already set by the lib_manager_prepare_module_adapter function.

Fix memory leak in lib_manager_register_module - free allocated driver structure when an unsupported loadable module api version is detected.

Add verification of the module id passed as a parameter to the lib_manager_get_mod_ctx function. Add error handling to the
lib_manager_free_module function.

Fix memory leak in module_adapter_new - add missing memory deallocation in the error handling code. This memory can be allocated by the module_adapter_init_data function.

Remove unnecessary call lib_manager_free_module from the modules_free function. Module release is already handled by lib_manager.

@softwarecki softwarecki changed the title Set of small fixes for loadable modules (lib_manager sp1) lib_manager: Set of small fixes for loadable modules (sp1) Apr 8, 2025
Extend the lib_manager_get_instance_bss_address function
to also return the size of the bss section. This simplify the
lib_manager_allocate_module_instance and lib_manager_free_module_instance
functions.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Remove redundant value assignment to ops.prepare in the
lib_manager_register_module function. This value is already set by the
lib_manager_prepare_module_adapter function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Free allocated driver structure when an unsupported loadable module api
version is detected.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Add verification of the module id passed as a parameter to the
lib_manager_get_mod_ctx function. Add error handling to the
lib_manager_free_module function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Add missing memory deallocation in the error handling code of the
module_adapter_new function. This memory can be allocated by the
module_adapter_init_data function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Remove unnecessary call lib_manager_free_module from the
modules_free function. Module release is already handled by lib_manager.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

Simplification is always good !

@lgirdwood
Copy link
Member

rerun CI, its missing test results.

@lgirdwood
Copy link
Member

SOFCI TEST

@lgirdwood lgirdwood merged commit 3ac35b0 into thesofproject:main Apr 11, 2025
43 of 50 checks passed
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.

6 participants