From d5cf0cbbf96bd5b7646990bb4aab00ef885e100f Mon Sep 17 00:00:00 2001 From: Wang Xin Date: Mon, 1 Dec 2025 17:11:06 +0800 Subject: [PATCH] obmm: bugfix: set up default mem allocator granule euleros inclusion category: bugfix bugzilla: https://gitee.com/openeuler/release-management/issues/ID45O2 CVE: NA ------------------------------------------------------------------ This commit fixes default mem allocator granule to make sure that when mem_allocator_granu is not specified, the allocator uses correct default granule, aligning with its expected behavior. Remove unused codes. Fixes: 84895087fb79 ("obmm: Implement memory pool allocator") Signed-off-by: Wang Xin --- drivers/ub/obmm/obmm_shm_dev.c | 3 --- drivers/ub/obmm/ubmempool_allocator.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/ub/obmm/obmm_shm_dev.c b/drivers/ub/obmm/obmm_shm_dev.c index f651399e712d..37e97d56e24d 100644 --- a/drivers/ub/obmm/obmm_shm_dev.c +++ b/drivers/ub/obmm/obmm_shm_dev.c @@ -874,9 +874,6 @@ const struct file_operations obmm_shm_fops = { .owner = THIS_MODULE, static void obmm_shm_dev_release(struct device *dev) { - struct obmm_region *reg; - - reg = container_of(dev, struct obmm_region, device); module_put(THIS_MODULE); } diff --git a/drivers/ub/obmm/ubmempool_allocator.c b/drivers/ub/obmm/ubmempool_allocator.c index a0a3e7060edd..b84ac40e614e 100644 --- a/drivers/ub/obmm/ubmempool_allocator.c +++ b/drivers/ub/obmm/ubmempool_allocator.c @@ -479,7 +479,7 @@ static int init_mem_allocator_granu(enum allocator_id aid) if (!mem_allocator_granu) { if (aid == ALLOCATOR_HUGETLB_PUD) __obmm_memseg_size = PUD_SIZE; - else if (aid == ALLOCATOR_HUGETLB_PMD) + else __obmm_memseg_size = PMD_SIZE; return 0; } -- Gitee