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/[email protected] Signed-off-by: Xin Hao <[email protected]> Reviewed-by: SeongJae Park <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f968c6a commit 15423a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)