mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 11:03:07 -04:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user