This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 0c2dde94d5a440526cfcec345c595038b73b2db6
Author: huojianchao <[email protected]>
AuthorDate: Mon Aug 4 20:50:18 2025 +0800

    kmm_free: delete check, check in mm_free and mm_delayfree
    
    kmm_free() and kmm_delayfree() asserted that the block belongs to the
    kernel heap before calling mm_free() and mm_delayfree(), which already
    assert mm_heapmember() on the heap they are given.  Drop the duplicate
    check.
    
    Signed-off-by: huojianchao <[email protected]>
---
 mm/kmm_heap/kmm_free.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/kmm_heap/kmm_free.c b/mm/kmm_heap/kmm_free.c
index 0db38d9ee68..12125dc4a6d 100644
--- a/mm/kmm_heap/kmm_free.c
+++ b/mm/kmm_heap/kmm_free.c
@@ -54,7 +54,6 @@
 
 void kmm_free(FAR void *mem)
 {
-  DEBUGASSERT((mem == NULL) || kmm_heapmember(mem));
   mm_free(KNR_HEAP, mem);
 }
 
@@ -74,7 +73,6 @@ void kmm_free(FAR void *mem)
 
 void kmm_delayfree(FAR void *mem)
 {
-  DEBUGASSERT((mem == NULL) || kmm_heapmember(mem));
   mm_delayfree(g_kmmheap, mem);
 }
 

Reply via email to