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

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


The following commit(s) were added to refs/heads/master by this push:
     new 975968db1bd mm/mempool: fix the entry condition for semaphore during 
mempool allocation
975968db1bd is described below

commit 975968db1bdaaf9458e72b2e4dfcbd9798013421
Author: zhanxiaoqi <[email protected]>
AuthorDate: Fri Feb 27 14:36:22 2026 +0800

    mm/mempool: fix the entry condition for semaphore during mempool allocation
    
    When the mempool uses the waitsem semaphore for memory allocation,
    the flowing two conditions must be satisfied simultaneously:
    its wait variable is set to true, and the expandsize variable is set to 0
    
    Signed-off-by: zhanxiaoqi <[email protected]>
---
 mm/mempool/mempool.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/mempool/mempool.c b/mm/mempool/mempool.c
index 49652fd6f5c..54ebb099b28 100644
--- a/mm/mempool/mempool.c
+++ b/mm/mempool/mempool.c
@@ -394,6 +394,7 @@ retry:
               blk = mempool_remove_queue(pool, &pool->queue);
             }
           else if (!pool->wait ||
+                   pool->expandsize > 0 ||
                    nxsem_wait_uninterruptible(&pool->waitsem) < 0)
             {
               return NULL;

Reply via email to