mm/damon/sysfs-schemes: kobject_del() scheme quota goal dirs

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 scheme quota goal directories by adding kobject_del()
calls.

Link: https://lore.kernel.org/20260628220121.97360-7-sj@kernel.org
Fixes: 7f262da0a3 ("mm/damon/sysfs-schemes: implement files for scheme quota goals setup")
Signed-off-by: SJ Park <sj@kernel.org>
Cc: <stable@vger.kernel.org> # 6.8.x
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
SJ Park
2026-06-28 15:01:15 -07:00
committed by Andrew Morton
parent 3c453bddac
commit 0d4397ca92

View File

@@ -1463,8 +1463,10 @@ static void damos_sysfs_quota_goals_rm_dirs(
struct damos_sysfs_quota_goal **goals_arr = goals->goals_arr;
int i;
for (i = 0; i < goals->nr; i++)
for (i = 0; i < goals->nr; i++) {
kobject_del(&goals_arr[i]->kobj);
kobject_put(&goals_arr[i]->kobj);
}
goals->nr = 0;
kfree(goals_arr);
goals->goals_arr = NULL;