From 975968db1bdaaf9458e72b2e4dfcbd9798013421 Mon Sep 17 00:00:00 2001 From: zhanxiaoqi Date: Fri, 27 Feb 2026 14:36:22 +0800 Subject: [PATCH] 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 --- 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;