On CONFIG_DEBUG_KOBJECT_RELEASE enabled kernel, lack of kobject_del() could cause directories creation failures due to the name conflicts. Fix the issue for data attribute probe filter directories in the error handling path of damon_sysfs_probes_add_dirs() by adding a kobject_del() call. Fixes: af7cb41af9a9 ("mm/damon/sysfs: implement filters directory") Signed-off-by: SJ Park --- mm/damon/sysfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 0ccdc71275d52..e3526a263e205 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -1181,6 +1181,7 @@ static int damon_sysfs_probes_add_dirs( err = damon_sysfs_probe_add_dirs(probe); if (err) { + kobject_del(&probe->kobj); kobject_put(&probe->kobj); damon_sysfs_probes_rm_dirs(probes); return err; -- 2.47.3