Skip to content

Commit 15423a5

Browse files
Xin Haotorvalds
authored andcommitted
mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release()
In damon_sysfs_kdamond_release(), we have use container_of() to get "kdamond" pointer, so there no need to get it once again. Link: https://lkml.kernel.org/r/20220303075314.22502-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao <xhao@linux.alibaba.com> Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent f968c6a commit 15423a5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mm/damon/sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2345,7 +2345,7 @@ static void damon_sysfs_kdamond_release(struct kobject *kobj)
23452345

23462346
if (kdamond->damon_ctx)
23472347
damon_destroy_ctx(kdamond->damon_ctx);
2348-
kfree(container_of(kobj, struct damon_sysfs_kdamond, kobj));
2348+
kfree(kdamond);
23492349
}
23502350

23512351
static struct kobj_attribute damon_sysfs_kdamond_state_attr =

0 commit comments

Comments
 (0)