[PATCH 08/11] mm/damon/sysfs: kobject_del() probe dirs

From: SJ Park

Date: Sun Jun 28 2026 - 18:04:49 EST


On CONFIG_DEBUG_KOBJECT_RELEASE enabled kernel, lack of kobject_del()
could cause directories creation failures due to the name conflicts. Fix
those issues for data attribute probe directories by adding
kobject_del() calls.

Fixes: bf3ea3d30880 ("mm/damon/sysfs: implement probe dir")
Signed-off-by: SJ Park <sj@xxxxxxxxxx>
---
mm/damon/sysfs.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
index 204aed6a3e5da..9f92ebdb28574 100644
--- a/mm/damon/sysfs.c
+++ b/mm/damon/sysfs.c
@@ -1137,6 +1137,7 @@ static void damon_sysfs_probes_rm_dirs(

for (i = 0; i < probes->nr; i++) {
damon_sysfs_probe_rm_dirs(probes_arr[i]);
+ kobject_del(&probes_arr[i]->kobj);
kobject_put(&probes_arr[i]->kobj);
}
probes->nr = 0;
--
2.47.3