Hi SJ, Here's the sysfs fix I mentioned in the report queue review. -- >8 -- While reviewing the DAMON report queue series, I noticed that DAMON sysfs still registers its interface if DAMON core initialization fails. If damon_init() fails to allocate damon_region_cache, starting a kdamond with an initial region can pass a NULL cache to kmem_cache_alloc() via damon_new_region(). Check damon_initialized() before creating the DAMON sysfs directory and return -ENOMEM if the core is unavailable. Fixes: a18709442869 ("mm/damon: improve damon_new_region strategy") Signed-off-by: Aveline Noir --- Tests passed in x86-64 QEMU TCG guests on 9f004372ebeb. --- mm/damon/sysfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 779c98205a94..7de0f03a3fd5 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -3035,6 +3035,9 @@ static int __init damon_sysfs_init(void) struct damon_sysfs_ui_dir *admin; int err; + if (!damon_initialized()) + return -ENOMEM; + damon_sysfs_root = kobject_create_and_add("damon", mm_kobj); if (!damon_sysfs_root) return -ENOMEM; --- base-commit: 9f004372ebeb18fdeb699f9880a0e472df90135b change-id: 20261123-damon-sysfs-init-guard-fc87e688acae -- Thanks, Aveline Noir