Skip to content

lib-manager: check for invalid module instance count#10927

Merged
kv2019i merged 1 commit into
thesofproject:mainfrom
lyakh:libm-instcnt
Jun 17, 2026
Merged

lib-manager: check for invalid module instance count#10927
kv2019i merged 1 commit into
thesofproject:mainfrom
lyakh:libm-instcnt

Conversation

@lyakh

@lyakh lyakh commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Module instance_max_count should never be 0, assume 1 if such a module is loaded.

Module instance_max_count should never be 0, assume 1 if such a
module is loaded.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Copilot AI review requested due to automatic review settings June 16, 2026 13:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a guard to prevent division-by-zero when calculating per-instance BSS size, treating an invalid instance_max_count == 0 as 1.

Changes:

  • Introduces a local inst_cnt that defaults to 1 when mod->instance_max_count is 0
  • Updates the BSS size calculation to divide by inst_cnt instead of mod->instance_max_count

Comment thread src/library_manager/lib_manager.c
Comment thread src/library_manager/lib_manager.c
@kv2019i kv2019i merged commit e62284b into thesofproject:main Jun 17, 2026
45 checks passed
@lyakh lyakh deleted the libm-instcnt branch June 17, 2026 09: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.

4 participants