Skip to content

Conversation

@softwarecki
Copy link
Collaborator

@softwarecki softwarecki commented Jan 16, 2025

Add k_panic() function call in error handling code to help detect potential memory release errors.

The vmh_free function returns an error if:

  1. heap belongs to another core,
  2. given pointer to be freed is invalid (doesn't belong to the allocator),
  3. there is an error in the code determining the size of the block to be freed
  4. memory unmapping fails.

Log entry is easy to miss, stopping the firmware at this point will draw attention to a critical problem related to memory allocation. Otherwise, it will have a slowly progressing memory leak.

If we decide this is a desirable change, we can merge it after #9776 and #9777 have been merged.

Add k_panic() function call in error handling code to help detect potential
memory release errors.

The vmh_free function returns an error if:
1. heap belongs to another core,
2. given pointer to be freed is invalid (doesn't belong to the allocator),
3. there is an error in the code determining the size of the block to be
   freed
4. memory unmapping fails.

Log entry is easy to miss, stopping the firmware at this point will draw
attention to a critical problem related to memory allocation. Otherwise,
it will have a slowly progressing memory leak.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
@lgirdwood lgirdwood merged commit 3932884 into thesofproject:main Feb 12, 2025
46 of 49 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