Commit 8cc43a9
committed
zephyr: alloc: virtual_heap_free: Panic on deallocations errors
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>1 parent d0930c8 commit 8cc43a9
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
261 | 261 | | |
| 262 | + | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| |||
0 commit comments